Class: Twilio::REST::Api::V2010::AccountContext::SipList::CredentialListInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, sid: nil) ⇒ CredentialListInstance

Initialize the CredentialListInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created this CredentialList resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 551

def initialize(version, payload , account_sid: nil, sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
        'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
        'friendly_name' => payload['friendly_name'],
        'sid' => payload['sid'],
        'subresource_uris' => payload['subresource_uris'],
        'uri' => payload['uri'],
    }

    # Context
    @instance_context = nil
    @params = { 'account_sid' =>   ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns The unique id of the [Account](www.twilio.com/docs/iam/api/account) that owns this resource.

Returns:



584
585
586
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 584

def 
    @properties['account_sid']
end

#contextCredentialListContext

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

Returns:



575
576
577
578
579
580
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 575

def context
    unless @instance_context
        @instance_context = CredentialListContext.new(@version , @params['account_sid'], @params['sid'])
    end
    @instance_context
end

#credentialscredentials

Access the credentials

Returns:



656
657
658
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 656

def credentials
    context.credentials
end

#date_createdTime

Returns The date that this resource was created, given as GMT in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.

Returns:



590
591
592
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 590

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date that this resource was last updated, given as GMT in [RFC 2822](www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format.

Returns:



596
597
598
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 596

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the CredentialListInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



627
628
629
630
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 627

def delete

    context.delete
end

#fetchCredentialListInstance

Fetch the CredentialListInstance

Returns:



635
636
637
638
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 635

def fetch

    context.fetch
end

#friendly_nameString

Returns A human readable descriptive text that describes the CredentialList, up to 64 characters long.

Returns:

  • (String)

    A human readable descriptive text that describes the CredentialList, up to 64 characters long.



602
603
604
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 602

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



669
670
671
672
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 669

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

#sidString

Returns A 34 character string that uniquely identifies this resource.

Returns:

  • (String)

    A 34 character string that uniquely identifies this resource.



608
609
610
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 608

def sid
    @properties['sid']
end

#subresource_urisHash

Returns A list of credentials associated with this credential list.

Returns:

  • (Hash)

    A list of credentials associated with this credential list.



614
615
616
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 614

def subresource_uris
    @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



662
663
664
665
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 662

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

#update(friendly_name: nil) ⇒ CredentialListInstance

Update the CredentialListInstance

Parameters:

  • friendly_name (String) (defaults to: nil)

    A human readable descriptive text for a CredentialList, up to 64 characters long.

Returns:



644
645
646
647
648
649
650
651
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 644

def update(
    friendly_name: nil
)

    context.update(
        friendly_name: friendly_name, 
    )
end

#uriString

Returns The URI for this resource, relative to https://api.twilio.com.

Returns:

  • (String)

    The URI for this resource, relative to https://api.twilio.com.



620
621
622
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 620

def uri
    @properties['uri']
end