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
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
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 289 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.
334 335 336 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 334 def account_sid @properties['account_sid'] end |
#challenges ⇒ challenges
Access the challenges
399 400 401 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 399 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
313 314 315 316 317 318 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 313 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.
346 347 348 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 346 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Entity was updated.
352 353 354 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 352 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the EntityInstance
371 372 373 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 371 def delete context.delete end |
#factors ⇒ factors
Access the factors
385 386 387 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 385 def factors context.factors end |
#fetch ⇒ EntityInstance
Fetch the EntityInstance
378 379 380 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 378 def fetch context.fetch end |
#identity ⇒ String
Returns Unique external identifier of the Entity.
328 329 330 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 328 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
412 413 414 415 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 412 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.EntityInstance #{values}>" end |
#links ⇒ String
Returns Nested resource URLs.
364 365 366 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 364 def links @properties['links'] end |
#new_factors ⇒ new_factors
Access the new_factors
392 393 394 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 392 def new_factors context.new_factors end |
#service_sid ⇒ String
Returns Service Sid.
340 341 342 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 340 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns A string that uniquely identifies this Entity.
322 323 324 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 322 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
405 406 407 408 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 405 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.
358 359 360 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 358 def url @properties['url'] end |