Class: SurgeAPI::Resources::Verifications
- Inherits:
-
Object
- Object
- SurgeAPI::Resources::Verifications
- Defined in:
- lib/surge_api/resources/verifications.rb
Instance Method Summary collapse
-
#check(id, code:, request_options: {}) ⇒ SurgeAPI::Models::VerificationCheck
Checks the code against a verification.
-
#create(phone_number:, request_options: {}) ⇒ SurgeAPI::Models::Verification
Creates a new Verification 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.
55 56 57 |
# File 'lib/surge_api/resources/verifications.rb', line 55 def initialize(client:) @client = client end |
Instance Method Details
#check(id, code:, request_options: {}) ⇒ SurgeAPI::Models::VerificationCheck
Checks the code against a verification.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/surge_api/resources/verifications.rb', line 41 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(phone_number:, request_options: {}) ⇒ SurgeAPI::Models::Verification
Creates a new Verification and sends the code to the given phone number.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/surge_api/resources/verifications.rb', line 17 def create(params) parsed, = SurgeAPI::VerificationCreateParams.dump_request(params) @client.request( method: :post, path: "verifications", body: parsed, model: SurgeAPI::Verification, options: ) end |