Class: Twilio::REST::Verify::V2::ServiceContext::AccessTokenInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Verify::V2::ServiceContext::AccessTokenInstance
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service/access_token.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account.
-
#context ⇒ AccessTokenContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this access token was created, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#entity_identity ⇒ String
The unique external identifier for the Entity of the Service.
-
#factor_friendly_name ⇒ String
A human readable description of this factor, up to 64 characters.
- #factor_type ⇒ FactorTypes
-
#fetch ⇒ AccessTokenInstance
Fetch the AccessTokenInstance.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ AccessTokenInstance
constructor
Initialize the AccessTokenInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#service_sid ⇒ String
The unique SID identifier of the Verify Service.
-
#sid ⇒ String
A 34 character string that uniquely identifies this Access Token.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#token ⇒ String
The access token generated for enrollment, this is an encrypted json web token.
-
#ttl ⇒ String
How long, in seconds, the access token is valid.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ AccessTokenInstance
Initialize the AccessTokenInstance
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 162 def initialize(version, payload , service_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'entity_identity' => payload['entity_identity'], 'factor_type' => payload['factor_type'], 'factor_friendly_name' => payload['factor_friendly_name'], 'token' => payload['token'], 'url' => payload['url'], 'ttl' => payload['ttl'] == nil ? payload['ttl'] : payload['ttl'].to_i, 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), } # Context @instance_context = nil @params = { 'service_sid' => service_sid || @properties['service_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
203 204 205 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 203 def account_sid @properties['account_sid'] end |
#context ⇒ AccessTokenContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
188 189 190 191 192 193 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 188 def context unless @instance_context @instance_context = AccessTokenContext.new(@version , @params['service_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
251 252 253 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 251 def date_created @properties['date_created'] end |
#entity_identity ⇒ String
215 216 217 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 215 def entity_identity @properties['entity_identity'] end |
#factor_friendly_name ⇒ String
227 228 229 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 227 def factor_friendly_name @properties['factor_friendly_name'] end |
#factor_type ⇒ FactorTypes
221 222 223 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 221 def factor_type @properties['factor_type'] end |
#fetch ⇒ AccessTokenInstance
Fetch the AccessTokenInstance
258 259 260 261 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 258 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
272 273 274 275 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 272 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.AccessTokenInstance #{values}>" end |
#service_sid ⇒ String
209 210 211 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 209 def service_sid @properties['service_sid'] end |
#sid ⇒ String
197 198 199 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 197 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
265 266 267 268 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 265 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.AccessTokenInstance #{values}>" end |
#token ⇒ String
233 234 235 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 233 def token @properties['token'] end |
#ttl ⇒ String
245 246 247 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 245 def ttl @properties['ttl'] end |
#url ⇒ String
239 240 241 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 239 def url @properties['url'] end |