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
Account Sid.
-
#context ⇒ AccessTokenContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this access token was created.
-
#entity_identity ⇒ String
Unique external identifier of the Entity.
-
#factor_friendly_name ⇒ String
A human readable description of this factor.
-
#factor_type ⇒ access_token.FactorTypes
The Type of the Factor.
-
#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
Verify Service Sid.
-
#sid ⇒ String
A string that uniquely identifies this Access Token.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#token ⇒ String
Generated access 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
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 143 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, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account Sid.
184 185 186 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 184 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
169 170 171 172 173 174 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 169 def context unless @instance_context @instance_context = AccessTokenContext.new(@version, @params['service_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this access token was created.
232 233 234 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 232 def date_created @properties['date_created'] end |
#entity_identity ⇒ String
Returns Unique external identifier of the Entity.
196 197 198 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 196 def entity_identity @properties['entity_identity'] end |
#factor_friendly_name ⇒ String
Returns A human readable description of this factor.
208 209 210 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 208 def factor_friendly_name @properties['factor_friendly_name'] end |
#factor_type ⇒ access_token.FactorTypes
Returns The Type of the Factor.
202 203 204 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 202 def factor_type @properties['factor_type'] end |
#fetch ⇒ AccessTokenInstance
Fetch the AccessTokenInstance
239 240 241 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 239 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
252 253 254 255 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 252 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.AccessTokenInstance #{values}>" end |
#service_sid ⇒ String
Returns Verify Service Sid.
190 191 192 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 190 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns A string that uniquely identifies this Access Token.
178 179 180 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 178 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
245 246 247 248 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 245 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.AccessTokenInstance #{values}>" end |
#token ⇒ String
Returns Generated access token.
214 215 216 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 214 def token @properties['token'] end |
#ttl ⇒ String
Returns How long, in seconds, the access token is valid.
226 227 228 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 226 def ttl @properties['ttl'] end |
#url ⇒ String
Returns The URL of this resource.
220 221 222 |
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 220 def url @properties['url'] end |