Class: SurgeAPI::Resources::Verifications
- Inherits:
-
Object
- Object
- SurgeAPI::Resources::Verifications
- Defined in:
- lib/surge_api/resources/verifications.rb,
sig/surge_api/resources/verifications.rbs
Instance Method Summary collapse
-
#check(id, code:, request_options: {}) ⇒ SurgeAPI::Models::VerificationCheck
Checks the code against a verification.
-
#create(account_id, phone_number:, request_options: {}) ⇒ SurgeAPI::Models::Verification
Creates a new Verification for an account and sends the code to the given phone number.
-
#initialize(client:) ⇒ Verifications
constructor
private
A new instance of Verifications.
Constructor Details
#initialize(client:) ⇒ Verifications
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Verifications.
58 59 60 |
# File 'lib/surge_api/resources/verifications.rb', line 58 def initialize(client:) @client = client end |
Instance Method Details
#check(id, code:, request_options: {}) ⇒ SurgeAPI::Models::VerificationCheck
Checks the code against a verification.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/surge_api/resources/verifications.rb', line 44 def check(id, params) parsed, = SurgeAPI::VerificationCheckParams.dump_request(params) @client.request( method: :post, path: ["verifications/%1$s/checks", id], body: parsed, model: SurgeAPI::VerificationCheck, options: ) end |
#create(account_id, phone_number:, request_options: {}) ⇒ SurgeAPI::Models::Verification
Creates a new Verification for an account and sends the code to the given phone number.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/surge_api/resources/verifications.rb', line 20 def create(account_id, params) parsed, = SurgeAPI::VerificationCreateParams.dump_request(params) @client.request( method: :post, path: ["accounts/%1$s/verifications", account_id], body: parsed, model: SurgeAPI::Verification, options: ) end |