Class: Twilio::REST::Verify::V2::ServiceContext::EntityInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, identity: nil) ⇒ EntityInstance

Initialize the EntityInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Entity resource.

  • sid (String)

    The SID of the Call resource to fetch.



522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 522

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  || @properties['service_sid']  ,'identity' => identity  || @properties['identity']  , }
end

Instance Method Details

#account_sidString

Returns The unique SID identifier of the Account.

Returns:

  • (String)

    The unique SID identifier of the Account.



568
569
570
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 568

def 
    @properties['account_sid']
end

#challengeschallenges

Access the challenges

Returns:



635
636
637
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 635

def challenges
    context.challenges
end

#contextEntityContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



547
548
549
550
551
552
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 547

def context
    unless @instance_context
        @instance_context = EntityContext.new(@version , @params['service_sid'], @params['identity'])
    end
    @instance_context
end

#date_createdTime

Returns The date that this Entity was created, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



580
581
582
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 580

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date that this Entity was updated, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



586
587
588
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 586

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the EntityInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



605
606
607
608
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 605

def delete

    context.delete
end

#factorsfactors

Access the factors

Returns:



628
629
630
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 628

def factors
    context.factors
end

#fetchEntityInstance

Fetch the EntityInstance

Returns:



613
614
615
616
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 613

def fetch

    context.fetch
end

#identityString

Returns The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user’s UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters.

Returns:

  • (String)

    The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user’s UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters.



562
563
564
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 562

def identity
    @properties['identity']
end

#inspectObject

Provide a detailed, user friendly representation



648
649
650
651
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 648

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Verify.V2.EntityInstance #{values}>"
end

Returns Contains a dictionary of URL links to nested resources of this Entity.

Returns:

  • (Hash)

    Contains a dictionary of URL links to nested resources of this Entity.



598
599
600
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 598

def links
    @properties['links']
end

#new_factorsnew_factors

Access the new_factors

Returns:



621
622
623
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 621

def new_factors
    context.new_factors
end

#service_sidString

Returns The unique SID identifier of the Service.

Returns:

  • (String)

    The unique SID identifier of the Service.



574
575
576
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 574

def service_sid
    @properties['service_sid']
end

#sidString

Returns A 34 character string that uniquely identifies this Entity.

Returns:

  • (String)

    A 34 character string that uniquely identifies this Entity.



556
557
558
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 556

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



641
642
643
644
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 641

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Verify.V2.EntityInstance #{values}>"
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



592
593
594
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 592

def url
    @properties['url']
end