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](www.twilio.com/docs/api/rest/account) that created the Token resource.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 93

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 that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



110
111
112
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 110

def 
  @properties['account_sid']
end

#date_createdTime

Returns The RFC 2822 date and time in GMT that the resource was created.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that the resource was created



116
117
118
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 116

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The RFC 2822 date and time in GMT that the resource was last updated.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that the resource was last updated



122
123
124
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 122

def date_updated
  @properties['date_updated']
end

#ice_serversString

Returns An array representing the ephemeral credentials.

Returns:

  • (String)

    An array representing the ephemeral credentials



128
129
130
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 128

def ice_servers
  @properties['ice_servers']
end

#inspectObject

Provide a detailed, user friendly representation



158
159
160
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 158

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

#passwordString

Returns The temporary password used for authenticating.

Returns:

  • (String)

    The temporary password used for authenticating



134
135
136
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 134

def password
  @properties['password']
end

#to_sObject

Provide a user friendly representation



152
153
154
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 152

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

#ttlString

Returns The duration in seconds the credentials are valid.

Returns:

  • (String)

    The duration in seconds the credentials are valid



140
141
142
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 140

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



146
147
148
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 146

def username
  @properties['username']
end