Class: Twilio::REST::Accounts::V1::SecondaryAuthTokenInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ SecondaryAuthTokenInstance

Initialize the SecondaryAuthTokenInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio


111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 111

def initialize(version, payload)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'secondary_auth_token' => payload['secondary_auth_token'],
      '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


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

def 
  @properties['account_sid']
end

#contextSecondaryAuthTokenContext

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

Returns:


132
133
134
135
136
137
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 132

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

#createSecondaryAuthTokenInstance

Create the SecondaryAuthTokenInstance

Returns:


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

def create
  context.create
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


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

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


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

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the SecondaryAuthTokenInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


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

def delete
  context.delete
end

#inspectObject

Provide a detailed, user friendly representation


192
193
194
195
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 192

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

#secondary_auth_tokenString

Returns The generated secondary Auth Token.

Returns:

  • (String)

    The generated secondary Auth Token


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

def secondary_auth_token
  @properties['secondary_auth_token']
end

#to_sObject

Provide a user friendly representation


185
186
187
188
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 185

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

#urlString

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

Returns:


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

def url
  @properties['url']
end