Class: Twilio::REST::Verify::V2::ServiceContext::VerificationCheckList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/verify/v2/service/verification_check.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid: nil) ⇒ VerificationCheckList

Initialize the VerificationCheckList

Parameters:

  • Version that contains the resource



28
29
30
31
32
33
34
35
# File 'lib/twilio-ruby/rest/verify/v2/service/verification_check.rb', line 28

def initialize(version, service_sid: nil)
    super(version)
    
    # Path Solution
    @solution = { service_sid: service_sid }
    @uri = "/Services/#{@solution[:service_sid]}/VerificationCheck"
    
end

Instance Method Details

#create(code: :unset, to: :unset, verification_sid: :unset, amount: :unset, payee: :unset, sna_client_token: :unset) ⇒ VerificationCheckInstance

Create the VerificationCheckInstance

Parameters:

  • (defaults to: :unset)

    The 4-10 character string being verified.

  • (defaults to: :unset)

    The phone number or [email](www.twilio.com/docs/verify/email) to verify. Either this parameter or the verification_sid must be specified. Phone numbers must be in [E.164 format](www.twilio.com/docs/glossary/what-e164).

  • (defaults to: :unset)

    A SID that uniquely identifies the Verification Check. Either this parameter or the to phone number/(www.twilio.com/docs/verify/email) must be specified.

  • (defaults to: :unset)

    The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.

  • (defaults to: :unset)

    The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.

  • (defaults to: :unset)

    A sna client token received in sna url invocation response needs to be passed in Verification Check request and should match to get successful response.

Returns:

  • Created VerificationCheckInstance



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/twilio-ruby/rest/verify/v2/service/verification_check.rb', line 45

def create(
    code: :unset, 
    to: :unset, 
    verification_sid: :unset, 
    amount: :unset, 
    payee: :unset, 
    sna_client_token: :unset
)

    data = Twilio::Values.of({
        'Code' => code,
        'To' => to,
        'VerificationSid' => verification_sid,
        'Amount' => amount,
        'Payee' => payee,
        'SnaClientToken' => sna_client_token,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.create('POST', @uri, data: data, headers: headers)
    VerificationCheckInstance.new(
        @version,
        payload,
        service_sid: @solution[:service_sid],
    )
end

#create_with_metadata(code: :unset, to: :unset, verification_sid: :unset, amount: :unset, payee: :unset, sna_client_token: :unset) ⇒ VerificationCheckInstance

Create the VerificationCheckInstanceMetadata

Parameters:

  • (defaults to: :unset)

    The 4-10 character string being verified.

  • (defaults to: :unset)

    The phone number or [email](www.twilio.com/docs/verify/email) to verify. Either this parameter or the verification_sid must be specified. Phone numbers must be in [E.164 format](www.twilio.com/docs/glossary/what-e164).

  • (defaults to: :unset)

    A SID that uniquely identifies the Verification Check. Either this parameter or the to phone number/(www.twilio.com/docs/verify/email) must be specified.

  • (defaults to: :unset)

    The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.

  • (defaults to: :unset)

    The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.

  • (defaults to: :unset)

    A sna client token received in sna url invocation response needs to be passed in Verification Check request and should match to get successful response.

Returns:

  • Created VerificationCheckInstance



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/twilio-ruby/rest/verify/v2/service/verification_check.rb', line 86

def (
  code: :unset, 
  to: :unset, 
  verification_sid: :unset, 
  amount: :unset, 
  payee: :unset, 
  sna_client_token: :unset
)

    data = Twilio::Values.of({
        'Code' => code,
        'To' => to,
        'VerificationSid' => verification_sid,
        'Amount' => amount,
        'Payee' => payee,
        'SnaClientToken' => sna_client_token,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('POST', @uri, data: data, headers: headers)
    verification_check_instance = VerificationCheckInstance.new(
        @version,
        response.body,
        service_sid: @solution[:service_sid],
    )
    .new(
        @version,
        verification_check_instance,
        response.headers,
        response.status_code
    )
end

#to_sObject

Provide a user friendly representation



128
129
130
# File 'lib/twilio-ruby/rest/verify/v2/service/verification_check.rb', line 128

def to_s
    '#<Twilio.Verify.V2.VerificationCheckList>'
end