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

  • account_sid (String)

    The SID of the Account that created this AuthTokenPromotion resource.

  • sid (String)

    The SID of the Call resource to fetch.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 129

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](www.twilio.com/docs/iam/api/account) that the secondary Auth Token was created for.

Returns:



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

def 
    @properties['account_sid']
end

#auth_tokenString

Returns The promoted Auth Token that must be used to authenticate future API requests.

Returns:

  • (String)

    The promoted Auth Token that must be used to authenticate future API requests.



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

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:



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

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

#date_createdTime

Returns The date and time in UTC when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



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

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



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

def date_updated
    @properties['date_updated']
end

#inspectObject

Provide a detailed, user friendly representation



204
205
206
207
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 204

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

#to_sObject

Provide a user friendly representation



197
198
199
200
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 197

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

#updateAuthTokenPromotionInstance

Update the AuthTokenPromotionInstance

Returns:



190
191
192
193
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 190

def update

    context.update
end

#urlString

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

Returns:



183
184
185
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 183

def url
    @properties['url']
end