Class: PreludeSDK::Resources::Verification

Inherits:
Object
  • Object
show all
Defined in:
lib/prelude_sdk/resources/verification.rb

Overview

Verify phone numbers.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Verification

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 Verification.

Parameters:



72
73
74
# File 'lib/prelude_sdk/resources/verification.rb', line 72

def initialize(client:)
  @client = client
end

Instance Method Details

#check(code:, target:, request_options: {}) ⇒ PreludeSDK::Models::VerificationCheckResponse

Some parameter documentations has been truncated, see Models::VerificationCheckParams for more details.

Check the validity of a verification code.

Parameters:

Returns:

See Also:



58
59
60
61
62
63
64
65
66
67
# File 'lib/prelude_sdk/resources/verification.rb', line 58

def check(params)
  parsed, options = PreludeSDK::VerificationCheckParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v2/verification/check",
    body: parsed,
    model: PreludeSDK::Models::VerificationCheckResponse,
    options: options
  )
end

#create(target:, dispatch_id: nil, metadata: nil, options: nil, signals: nil, request_options: {}) ⇒ PreludeSDK::Models::VerificationCreateResponse

Some parameter documentations has been truncated, see Models::VerificationCreateParams for more details.

Create a new verification for a specific phone number. If another non-expired verification exists (the request is performed within the verification window), this endpoint will perform a retry instead.

Parameters:

Returns:

See Also:



31
32
33
34
35
36
37
38
39
40
# File 'lib/prelude_sdk/resources/verification.rb', line 31

def create(params)
  parsed, options = PreludeSDK::VerificationCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v2/verification",
    body: parsed,
    model: PreludeSDK::Models::VerificationCreateResponse,
    options: options
  )
end