Class: MethodRuby::Resources::Entities::VerificationSessions
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Entities::VerificationSessions
- Defined in:
- lib/method_ruby/resources/entities/verification_sessions.rb
Overview
Verification sessions for entities
Instance Method Summary collapse
-
#create(entity_id, method_:, type:, method_version:, byo_kyc: nil, byo_sms: nil, kba: nil, sms: nil, sna: nil, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Entities::VerificationSessionCreateResponse
Some parameter documentations has been truncated, see Models::Entities::VerificationSessionCreateParams for more details.
-
#initialize(client:) ⇒ VerificationSessions
constructor
private
A new instance of VerificationSessions.
-
#list(entity_id, method_version:, from_date: nil, page: nil, page_cursor: nil, page_limit: nil, to_date: nil, request_options: {}) ⇒ MethodRuby::Models::Entities::VerificationSessionListResponse
Some parameter documentations has been truncated, see Models::Entities::VerificationSessionListParams for more details.
-
#retrieve(evf_id, entity_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Entities::VerificationSessionRetrieveResponse
Some parameter documentations has been truncated, see Models::Entities::VerificationSessionRetrieveParams for more details.
-
#update(evf_id, entity_id:, method_:, type:, method_version:, kba: nil, sms: nil, sna: nil, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Entities::VerificationSessionUpdateResponse
Some parameter documentations has been truncated, see Models::Entities::VerificationSessionUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ VerificationSessions
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 VerificationSessions.
185 186 187 |
# File 'lib/method_ruby/resources/entities/verification_sessions.rb', line 185 def initialize(client:) @client = client end |
Instance Method Details
#create(entity_id, method_:, type:, method_version:, byo_kyc: nil, byo_sms: nil, kba: nil, sms: nil, sna: nil, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Entities::VerificationSessionCreateResponse
Some parameter documentations has been truncated, see Models::Entities::VerificationSessionCreateParams for more details.
Creates a new verification session for the specified entity.
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/method_ruby/resources/entities/verification_sessions.rb', line 41 def create(entity_id, params) parsed, = MethodRuby::Entities::VerificationSessionCreateParams.dump_request(params) header_params = {method_version: "method-version", idempotency_key: "idempotency-key"} @client.request( method: :post, path: ["entities/%1$s/verification_sessions", entity_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: MethodRuby::Models::Entities::VerificationSessionCreateResponse, security: {secret_key: true}, options: ) end |
#list(entity_id, method_version:, from_date: nil, page: nil, page_cursor: nil, page_limit: nil, to_date: nil, request_options: {}) ⇒ MethodRuby::Models::Entities::VerificationSessionListResponse
Some parameter documentations has been truncated, see Models::Entities::VerificationSessionListParams for more details.
Returns a list of verification sessions for the specified entity.
167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/method_ruby/resources/entities/verification_sessions.rb', line 167 def list(entity_id, params) query_params = [:from_date, :page, :page_cursor, :page_limit, :to_date] parsed, = MethodRuby::Entities::VerificationSessionListParams.dump_request(params) query = MethodRuby::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: ["entities/%1$s/verification_sessions", entity_id], query: query, headers: parsed.except(*query_params).transform_keys(method_version: "method-version"), model: MethodRuby::Models::Entities::VerificationSessionListResponse, security: {secret_key: true}, options: ) end |
#retrieve(evf_id, entity_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Entities::VerificationSessionRetrieveResponse
Some parameter documentations has been truncated, see Models::Entities::VerificationSessionRetrieveParams for more details.
Returns a single entity verification session by its identifier.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/method_ruby/resources/entities/verification_sessions.rb', line 74 def retrieve(evf_id, params) parsed, = MethodRuby::Entities::VerificationSessionRetrieveParams.dump_request(params) entity_id = parsed.delete(:entity_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["entities/%1$s/verification_sessions/%2$s", entity_id, evf_id], headers: parsed.transform_keys(method_version: "method-version"), model: MethodRuby::Models::Entities::VerificationSessionRetrieveResponse, security: {secret_key: true}, options: ) end |
#update(evf_id, entity_id:, method_:, type:, method_version:, kba: nil, sms: nil, sna: nil, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Entities::VerificationSessionUpdateResponse
Some parameter documentations has been truncated, see Models::Entities::VerificationSessionUpdateParams for more details.
Updates a verification session, for example by submitting an SMS verification code or KBA answers. The request body shape depends on the verification type and method.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/method_ruby/resources/entities/verification_sessions.rb', line 123 def update(evf_id, params) parsed, = MethodRuby::Entities::VerificationSessionUpdateParams.dump_request(params) entity_id = parsed.delete(:entity_id) do raise ArgumentError.new("missing required path argument #{_1}") end header_params = {method_version: "method-version", idempotency_key: "idempotency-key"} @client.request( method: :put, path: ["entities/%1$s/verification_sessions/%2$s", entity_id, evf_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: MethodRuby::Models::Entities::VerificationSessionUpdateResponse, security: {secret_key: true}, options: ) end |