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 preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
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(twilio_sandbox_mode: :unset) ⇒ Boolean
Delete the EntityInstance.
-
#factors ⇒ factors
Access the factors.
-
#fetch(twilio_sandbox_mode: :unset) ⇒ 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.
-
#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
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 286 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.
331 332 333 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 331 def account_sid @properties['account_sid'] end |
#challenges ⇒ challenges
Access the challenges
391 392 393 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 391 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
310 311 312 313 314 315 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 310 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.
343 344 345 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 343 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Entity was updated.
349 350 351 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 349 def date_updated @properties['date_updated'] end |
#delete(twilio_sandbox_mode: :unset) ⇒ Boolean
Delete the EntityInstance
369 370 371 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 369 def delete(twilio_sandbox_mode: :unset) context.delete(twilio_sandbox_mode: twilio_sandbox_mode, ) end |
#factors ⇒ factors
Access the factors
384 385 386 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 384 def factors context.factors end |
#fetch(twilio_sandbox_mode: :unset) ⇒ EntityInstance
Fetch the EntityInstance
377 378 379 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 377 def fetch(twilio_sandbox_mode: :unset) context.fetch(twilio_sandbox_mode: twilio_sandbox_mode, ) end |
#identity ⇒ String
Returns Unique external identifier of the Entity.
325 326 327 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 325 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
404 405 406 407 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 404 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.EntityInstance #{values}>" end |
#links ⇒ String
Returns Nested resource URLs.
361 362 363 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 361 def links @properties['links'] end |
#service_sid ⇒ String
Returns Service Sid.
337 338 339 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 337 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns A string that uniquely identifies this Entity.
319 320 321 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 319 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
397 398 399 400 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 397 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.
355 356 357 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 355 def url @properties['url'] end |