Class: Vonage::Verify2
- Inherits:
-
Namespace
- Object
- Namespace
- Vonage::Verify2
- Defined in:
- lib/vonage/verify2.rb
Defined Under Namespace
Classes: StartVerificationOptions, TemplateFragments, Templates, Workflow, WorkflowBuilder
Instance Method Summary collapse
-
#cancel_verification_request(request_id:) ⇒ Object
Cancel a verifiction.
-
#check_code(request_id:, code:) ⇒ Object
Check a supplied code against a request to see if it is valid.
- #next_workflow(request_id:) ⇒ Object
-
#start_verification(brand:, workflow:, **opts) ⇒ Object
Request a verification be sent to a user.
-
#start_verification_options(**opts) ⇒ Object
Instantiate a new Vonage::Verify2::StartVerificationOptions object.
-
#template_fragments ⇒ TemplateFragments
Returns existing or instantiates a new Vonage::Verify2::Templates object.
-
#templates ⇒ Templates
Returns existing or instantiates a new Vonage::Verify2::Templates object.
-
#workflow ⇒ Object
Instantiate a new Vonage::Verify2::Workflow object.
-
#workflow_builder ⇒ Object
Return the Vonage::Verify2::WorkflowBuilder class.
Instance Method Details
#cancel_verification_request(request_id:) ⇒ Object
Cancel a verifiction. If a verification request is still active, calling this method aborts the workflow.
68 69 70 |
# File 'lib/vonage/verify2.rb', line 68 def cancel_verification_request(request_id:) request('/v2/verify/' + request_id, type: Delete) end |
#check_code(request_id:, code:) ⇒ Object
Check a supplied code against a request to see if it is valid.
55 56 57 |
# File 'lib/vonage/verify2.rb', line 55 def check_code(request_id:, code:) request('/v2/verify/' + request_id, params: {code: code}, type: Post) end |
#next_workflow(request_id:) ⇒ Object
72 73 74 |
# File 'lib/vonage/verify2.rb', line 72 def next_workflow(request_id:) request('/v2/verify/' + request_id + '/next-workflow', type: Post) end |
#start_verification(brand:, workflow:, **opts) ⇒ Object
Request a verification be sent to a user.
35 36 37 38 39 40 41 42 |
# File 'lib/vonage/verify2.rb', line 35 def start_verification(brand:, workflow:, **opts) raise ArgumentError, ':brand must be a String' unless brand.is_a?(String) raise ArgumentError, "Invalid 'brand' value #{brand}. Length must be between 1 and 16 characters." unless brand.length.between?(1, 16) raise ArgumentError, ':workflow must be an Array' unless workflow.is_a?(Array) raise ArgumentError, ':workflow must not be empty' if workflow.empty? request('/v2/verify/', params: opts.merge(brand: brand, workflow: workflow), type: Post) end |
#start_verification_options(**opts) ⇒ Object
Instantiate a new Vonage::Verify2::StartVerificationOptions object
86 87 88 |
# File 'lib/vonage/verify2.rb', line 86 def (**opts) StartVerificationOptions.new(**opts) end |
#template_fragments ⇒ TemplateFragments
Returns existing or instantiates a new Vonage::Verify2::Templates object
108 109 110 |
# File 'lib/vonage/verify2.rb', line 108 def template_fragments @template_fragments ||= TemplateFragments.new(@config) end |
#templates ⇒ Templates
Returns existing or instantiates a new Vonage::Verify2::Templates object
102 103 104 |
# File 'lib/vonage/verify2.rb', line 102 def templates @templates ||= Templates.new(@config) end |
#workflow ⇒ Object
Instantiate a new Vonage::Verify2::Workflow object
91 92 93 |
# File 'lib/vonage/verify2.rb', line 91 def workflow Workflow.new end |
#workflow_builder ⇒ Object
Return the Vonage::Verify2::WorkflowBuilder class
96 97 98 |
# File 'lib/vonage/verify2.rb', line 96 def workflow_builder WorkflowBuilder.itself end |