Class: Twilio::REST::Verify::V2::ServiceContext::EntityInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Verify::V2::ServiceContext::EntityInstance
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service/entity.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
Account Sid.
-
#challenges ⇒ challenges
Access the challenges.
-
#context ⇒ EntityContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this Entity was created.
-
#date_updated ⇒ Time
The date this Entity was updated.
-
#delete ⇒ Boolean
Delete the EntityInstance.
-
#factors ⇒ factors
Access the factors.
-
#fetch ⇒ EntityInstance
Fetch the EntityInstance.
-
#identity ⇒ String
Unique external identifier of the Entity.
-
#initialize(version, payload, service_sid: nil, identity: nil) ⇒ EntityInstance
constructor
Initialize the EntityInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
Nested resource URLs.
-
#new_factors ⇒ new_factors
Access the new_factors.
-
#service_sid ⇒ String
Service Sid.
-
#sid ⇒ String
A string that uniquely identifies this Entity.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, service_sid: nil, identity: nil) ⇒ EntityInstance
Initialize the EntityInstance
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 293 def initialize(version, payload, service_sid: nil, identity: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'identity' => payload['identity'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'service_sid' => service_sid, 'identity' => identity || @properties['identity'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account Sid.
338 339 340 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 338 def account_sid @properties['account_sid'] end |
#challenges ⇒ challenges
Access the challenges
403 404 405 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 403 def challenges context.challenges end |
#context ⇒ EntityContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
317 318 319 320 321 322 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 317 def context unless @instance_context @instance_context = EntityContext.new(@version, @params['service_sid'], @params['identity'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this Entity was created.
350 351 352 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 350 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Entity was updated.
356 357 358 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 356 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the EntityInstance
375 376 377 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 375 def delete context.delete end |
#factors ⇒ factors
Access the factors
389 390 391 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 389 def factors context.factors end |
#fetch ⇒ EntityInstance
Fetch the EntityInstance
382 383 384 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 382 def fetch context.fetch end |
#identity ⇒ String
Returns Unique external identifier of the Entity.
332 333 334 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 332 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
416 417 418 419 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 416 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.EntityInstance #{values}>" end |
#links ⇒ String
Returns Nested resource URLs.
368 369 370 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 368 def links @properties['links'] end |
#new_factors ⇒ new_factors
Access the new_factors
396 397 398 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 396 def new_factors context.new_factors end |
#service_sid ⇒ String
Returns Service Sid.
344 345 346 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 344 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns A string that uniquely identifies this Entity.
326 327 328 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 326 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
409 410 411 412 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 409 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.EntityInstance #{values}>" end |
#url ⇒ String
Returns The URL of this resource.
362 363 364 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 362 def url @properties['url'] end |