Class: Twilio::REST::Verify::V2::ServiceContext::VerificationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Verify::V2::ServiceContext::VerificationInstance
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service/verification.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#amount ⇒ String
The amount of the associated PSD2 compliant transaction.
-
#channel ⇒ verification.Channel
The verification method used.
-
#context ⇒ VerificationContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The RFC 2822 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The RFC 2822 date and time in GMT when the resource was last updated.
-
#fetch ⇒ VerificationInstance
Fetch the VerificationInstance.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ VerificationInstance
constructor
Initialize the VerificationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#lookup ⇒ Hash
Information about the phone number being verified.
-
#payee ⇒ String
The payee of the associated PSD2 compliant transaction.
-
#send_code_attempts ⇒ Array[Hash]
An array of verification attempt objects.
-
#service_sid ⇒ String
The SID of the Service that the resource is associated with.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#status ⇒ String
The status of the verification resource.
-
#to ⇒ String
The phone number or email being verified.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: nil) ⇒ VerificationInstance
Update the VerificationInstance.
-
#url ⇒ String
The absolute URL of the Verification resource.
-
#valid ⇒ Boolean
Whether the verification was successful.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ VerificationInstance
Initialize the VerificationInstance
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 211 def initialize(version, payload, service_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'service_sid' => payload['service_sid'], 'account_sid' => payload['account_sid'], 'to' => payload['to'], 'channel' => payload['channel'], 'status' => payload['status'], 'valid' => payload['valid'], 'lookup' => payload['lookup'], 'amount' => payload['amount'], 'payee' => payload['payee'], 'send_code_attempts' => payload['send_code_attempts'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], } # Context @instance_context = nil @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created the resource.
262 263 264 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 262 def account_sid @properties['account_sid'] end |
#amount ⇒ String
Returns The amount of the associated PSD2 compliant transaction.
298 299 300 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 298 def amount @properties['amount'] end |
#channel ⇒ verification.Channel
Returns The verification method used.
274 275 276 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 274 def channel @properties['channel'] end |
#context ⇒ VerificationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
241 242 243 244 245 246 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 241 def context unless @instance_context @instance_context = VerificationContext.new(@version, @params['service_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The RFC 2822 date and time in GMT when the resource was created.
316 317 318 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 316 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The RFC 2822 date and time in GMT when the resource was last updated.
322 323 324 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 322 def date_updated @properties['date_updated'] end |
#fetch ⇒ VerificationInstance
Fetch the VerificationInstance
344 345 346 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 344 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
357 358 359 360 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 357 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.VerificationInstance #{values}>" end |
#lookup ⇒ Hash
Returns Information about the phone number being verified.
292 293 294 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 292 def lookup @properties['lookup'] end |
#payee ⇒ String
Returns The payee of the associated PSD2 compliant transaction.
304 305 306 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 304 def payee @properties['payee'] end |
#send_code_attempts ⇒ Array[Hash]
Returns An array of verification attempt objects.
310 311 312 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 310 def send_code_attempts @properties['send_code_attempts'] end |
#service_sid ⇒ String
Returns The SID of the Service that the resource is associated with.
256 257 258 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 256 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The unique string that identifies the resource.
250 251 252 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 250 def sid @properties['sid'] end |
#status ⇒ String
Returns The status of the verification resource.
280 281 282 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 280 def status @properties['status'] end |
#to ⇒ String
Returns The phone number or email being verified.
268 269 270 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 268 def to @properties['to'] end |
#to_s ⇒ Object
Provide a user friendly representation
350 351 352 353 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 350 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.VerificationInstance #{values}>" end |
#update(status: nil) ⇒ VerificationInstance
Update the VerificationInstance
337 338 339 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 337 def update(status: nil) context.update(status: status, ) end |
#url ⇒ String
Returns The absolute URL of the Verification resource.
328 329 330 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 328 def url @properties['url'] end |
#valid ⇒ Boolean
Returns Whether the verification was successful.
286 287 288 |
# File 'lib/twilio-ruby/rest/verify/v2/service/verification.rb', line 286 def valid @properties['valid'] end |