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


88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 88

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


105
106
107
# File 'lib/twilio-ruby/rest/api/v2010/account/token.rb', line 105

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


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

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


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

def date_updated
  @properties['date_updated']
end

#ice_serversArray[String]

Returns An array representing the ephemeral credentials.

Returns:

  • (Array[String])

    An array representing the ephemeral credentials


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

def ice_servers
  @properties['ice_servers']
end

#inspectObject

Provide a detailed, user friendly representation


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

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

#passwordString

Returns The temporary password used for authenticating.

Returns:

  • (String)

    The temporary password used for authenticating


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

def password
  @properties['password']
end

#to_sObject

Provide a user friendly representation


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

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


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

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


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

def username
  @properties['username']
end