Class: Twilio::REST::Api::V2010::AccountContext::TokenInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil) ⇒ TokenInstance

Initialize the TokenInstance

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 Token resource.

  • sid (String)

    The SID of the Call resource to fetch.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 101

def initialize(version, payload , account_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']),
        'ice_servers' => payload['ice_servers'],
        'password' => payload['password'],
        'ttl' => payload['ttl'],
        'username' => payload['username'],
    }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Token resource.

Returns:



119
120
121
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 119

def 
    @properties['account_sid']
end

#date_createdTime

Returns The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



125
126
127
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 125

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



131
132
133
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 131

def date_updated
    @properties['date_updated']
end

#ice_serversArray<ApiV2010AccountTokenIceServers>

Returns An array representing the ephemeral credentials and the STUN and TURN server URIs.

Returns:

  • (Array<ApiV2010AccountTokenIceServers>)

    An array representing the ephemeral credentials and the STUN and TURN server URIs.



137
138
139
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 137

def ice_servers
    @properties['ice_servers']
end

#inspectObject

Provide a detailed, user friendly representation



167
168
169
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 167

def inspect
    "<Twilio.Api.V2010.TokenInstance>"
end

#passwordString

Returns The temporary password that the username will use when authenticating with Twilio.

Returns:

  • (String)

    The temporary password that the username will use when authenticating with Twilio.



143
144
145
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 143

def password
    @properties['password']
end

#to_sObject

Provide a user friendly representation



161
162
163
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 161

def to_s
    "<Twilio.Api.V2010.TokenInstance>"
end

#ttlString

Returns The duration in seconds for which the username and password are valid.

Returns:

  • (String)

    The duration in seconds for which the username and password are valid.



149
150
151
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 149

def ttl
    @properties['ttl']
end

#usernameString

Returns The temporary username that uniquely identifies a Token.

Returns:

  • (String)

    The temporary username that uniquely identifies a Token.



155
156
157
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 155

def username
    @properties['username']
end