Class: Twilio::REST::Accounts::V1::AuthTokenPromotionInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ AuthTokenPromotionInstance

Initialize the AuthTokenPromotionInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio


104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 104

def initialize(version, payload)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'auth_token' => payload['auth_token'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {}
end

Instance Method Details

#account_sidString

Returns The SID of the Account that the secondary Auth Token was created for.

Returns:

  • (String)

    The SID of the Account that the secondary Auth Token was created for


134
135
136
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 134

def 
  @properties['account_sid']
end

#auth_tokenString

Returns The promoted Auth Token.

Returns:

  • (String)

    The promoted Auth Token


140
141
142
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 140

def auth_token
  @properties['auth_token']
end

#contextAuthTokenPromotionContext

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

Returns:


125
126
127
128
129
130
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 125

def context
  unless @instance_context
    @instance_context = AuthTokenPromotionContext.new(@version, )
  end
  @instance_context
end

#date_createdTime

Returns The ISO 8601 formatted date and time in UTC when the resource was created.

Returns:

  • (Time)

    The ISO 8601 formatted date and time in UTC when the resource was created


146
147
148
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 146

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The ISO 8601 formatted date and time in UTC when the resource was last updated.

Returns:

  • (Time)

    The ISO 8601 formatted date and time in UTC when the resource was last updated


152
153
154
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 152

def date_updated
  @properties['date_updated']
end

#inspectObject

Provide a detailed, user friendly representation


178
179
180
181
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 178

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

#to_sObject

Provide a user friendly representation


171
172
173
174
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 171

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

#updateAuthTokenPromotionInstance

Update the AuthTokenPromotionInstance

Returns:


165
166
167
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 165

def update
  context.update
end

#urlString

Returns The URI for this resource, relative to `accounts.twilio.com`.

Returns:


158
159
160
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 158

def url
  @properties['url']
end