Class: Twilio::REST::Accounts::V1::SecondaryAuthTokenInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Accounts::V1::SecondaryAuthTokenInstance
- Defined in:
- lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that the secondary Auth Token was created for.
-
#context ⇒ SecondaryAuthTokenContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#create ⇒ SecondaryAuthTokenInstance
Create the SecondaryAuthTokenInstance.
-
#date_created ⇒ Time
The date and time in UTC when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in UTC when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the SecondaryAuthTokenInstance.
-
#initialize(version, payload) ⇒ SecondaryAuthTokenInstance
constructor
Initialize the SecondaryAuthTokenInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#secondary_auth_token ⇒ String
The generated secondary Auth Token that can be used to authenticate future API requests.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URI for this resource, relative to ‘accounts.twilio.com`.
Constructor Details
#initialize(version, payload) ⇒ SecondaryAuthTokenInstance
Initialize the SecondaryAuthTokenInstance
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 130 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_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that the secondary Auth Token was created for.
160 161 162 |
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 160 def account_sid @properties['account_sid'] end |
#context ⇒ SecondaryAuthTokenContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
151 152 153 154 155 156 |
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 151 def context unless @instance_context @instance_context = SecondaryAuthTokenContext.new(@version ) end @instance_context end |
#create ⇒ SecondaryAuthTokenInstance
Create the SecondaryAuthTokenInstance
191 192 193 194 |
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 191 def create context.create end |
#date_created ⇒ Time
Returns The date and time in UTC when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
166 167 168 |
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 166 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in UTC when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
172 173 174 |
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 172 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the SecondaryAuthTokenInstance
199 200 201 202 |
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 199 def delete context.delete end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
213 214 215 216 |
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 213 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Accounts.V1.SecondaryAuthTokenInstance #{values}>" end |
#secondary_auth_token ⇒ String
Returns The generated secondary Auth Token that can be used to authenticate future API requests.
178 179 180 |
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 178 def secondary_auth_token @properties['secondary_auth_token'] end |
#to_s ⇒ Object
Provide a user friendly representation
206 207 208 209 |
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 206 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Accounts.V1.SecondaryAuthTokenInstance #{values}>" end |
#url ⇒ String
Returns The URI for this resource, relative to ‘accounts.twilio.com`.
184 185 186 |
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 184 def url @properties['url'] end |