Class: PreludeSDK::Resources::VerificationManagement::Sandbox

Inherits:
Object
  • Object
show all
Defined in:
lib/prelude_sdk/resources/verification_management/sandbox.rb,
sig/prelude_sdk/resources/verification_management/sandbox.rbs

Overview

Verify phone numbers.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Sandbox

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

Parameters:



93
94
95
# File 'lib/prelude_sdk/resources/verification_management/sandbox.rb', line 93

def initialize(client:)
  @client = client
end

Instance Method Details

#add_phone_number(attempt_code:, phone_number:, request_options: {}) ⇒ PreludeSDK::Models::VerificationManagement::SandboxAddPhoneNumberResponse

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

Register a phone number as a sandbox number and associate it with a fixed attempt code. Subsequent verification attempts against this number will not trigger a real SMS/call and will validate against the configured attempt code.

This operation is idempotent - re-adding the same phone number will overwrite the existing attempt code.

In order to get access to this endpoint, contact our support team.

Parameters:

  • attempt_code (String) —

    The fixed attempt code that will validate verification attempts for this phone n

  • phone_number (String) —

    An E.164 formatted phone number to add to the sandbox list.

  • request_options (PreludeSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



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

def add_phone_number(params)
  parsed, options = PreludeSDK::VerificationManagement::SandboxAddPhoneNumberParams.dump_request(params)
  @client.request(
    method: :put,
    path: "v2/verification/management/phone-numbers/sandbox",
    body: parsed,
    model: PreludeSDK::Models::VerificationManagement::SandboxAddPhoneNumberResponse,
    options: options
  )
end

#delete_phone_number(phone_number, request_options: {}) ⇒ PreludeSDK::Models::VerificationManagement::SandboxDeletePhoneNumberResponse

Remove a phone number from the sandbox list.

This operation is idempotent - deleting a phone number that is not in the sandbox list will succeed without making any changes.

In order to get access to this endpoint, contact our support team.

Parameters:

  • phone_number (String) —

    The E.164 formatted phone number to remove from the sandbox list.

  • request_options (PreludeSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



59
60
61
62
63
64
65
66
# File 'lib/prelude_sdk/resources/verification_management/sandbox.rb', line 59

def delete_phone_number(phone_number, params = {})
  @client.request(
    method: :delete,
    path: ["v2/verification/management/phone-numbers/sandbox/%1$s", phone_number],
    model: PreludeSDK::Models::VerificationManagement::SandboxDeletePhoneNumberResponse,
    options: params[:request_options]
  )
end

#list_phone_numbers(request_options: {}) ⇒ PreludeSDK::Models::VerificationManagement::SandboxListPhoneNumbersResponse

Retrieve the list of sandbox phone numbers for the account. Sandbox numbers are test numbers that bypass the real verification flow and return a fixed attempt code.

In order to get access to this endpoint, contact our support team.



81
82
83
84
85
86
87
88
# File 'lib/prelude_sdk/resources/verification_management/sandbox.rb', line 81

def list_phone_numbers(params = {})
  @client.request(
    method: :get,
    path: "v2/verification/management/phone-numbers/sandbox",
    model: PreludeSDK::Models::VerificationManagement::SandboxListPhoneNumbersResponse,
    options: params[:request_options]
  )
end