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.



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 218

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_sid ⇒ String

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.



249
250
251
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 249

def 
    @properties['account_sid']
end

#auth_token ⇒ String

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.



255
256
257
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 255

def auth_token
    @properties['auth_token']
end

#context ⇒ AuthTokenPromotionContext

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

Returns:



240
241
242
243
244
245
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 240

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

#date_created ⇒ Time

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

Returns:

  • (Time) —

    The date and time in UTC when the resource was created specified in ISO 8601 format.



261
262
263
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 261

def date_created
    @properties['date_created']
end

#date_updated ⇒ Time

Returns The date and time in GMT when the resource was last updated specified in ISO 8601 format.

Returns:

  • (Time) —

    The date and time in GMT when the resource was last updated specified in ISO 8601 format.



267
268
269
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 267

def date_updated
    @properties['date_updated']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



299
300
301
302
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 299

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

#to_s ⇒ Object

Provide a user friendly representation



292
293
294
295
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 292

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

#update(suppress_email_notification: :unset) ⇒ AuthTokenPromotionInstance

Update the AuthTokenPromotionInstance

Parameters:

  • suppress_email_notification (Boolean) (defaults to: :unset) —

    Whether to suppress the email notification that Twilio sends to the owners and administrators of the account about this Auth Token change. Defaults to false, so Twilio sends the email. Set to true when rotating Auth Tokens across many subaccounts.

Returns:



281
282
283
284
285
286
287
288
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 281

def update(
  suppress_email_notification: :unset
)

    context.update(
        suppress_email_notification: suppress_email_notification, 
    )
end

#url ⇒ String

Returns The URI for this resource, relative to https://accounts.twilio.com.

Returns:

  • (String) —

    The URI for this resource, relative to https://accounts.twilio.com



273
274
275
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 273

def url
    @properties['url']
end