Class: Twilio::REST::Verify::V2::ServiceContext::AccessTokenInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/verify/v2/service/access_token.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, sid: nil) ⇒ AccessTokenInstance

Initialize the AccessTokenInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • service_sid (String) (defaults to: nil)

    The unique SID identifier of the Verify Service.

  • sid (String) (defaults to: nil)

    A 34 character string that uniquely identifies this Access Token.



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 148

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'],
  }

  # Context
  @instance_context = nil
  @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
end

Instance Method Details

#account_sidString

Returns Account Sid.

Returns:

  • (String)

    Account Sid.



187
188
189
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 187

def 
  @properties['account_sid']
end

#contextAccessTokenContext

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

Returns:



172
173
174
175
176
177
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 172

def context
  unless @instance_context
    @instance_context = AccessTokenContext.new(@version, @params['service_sid'], @params['sid'], )
  end
  @instance_context
end

#entity_identityString

Returns Unique external identifier of the Entity.

Returns:

  • (String)

    Unique external identifier of the Entity



199
200
201
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 199

def entity_identity
  @properties['entity_identity']
end

#factor_friendly_nameString

Returns A human readable description of this factor.

Returns:

  • (String)

    A human readable description of this factor.



211
212
213
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 211

def factor_friendly_name
  @properties['factor_friendly_name']
end

#factor_typeaccess_token.FactorTypes

Returns The Type of the Factor.

Returns:

  • (access_token.FactorTypes)

    The Type of the Factor



205
206
207
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 205

def factor_type
  @properties['factor_type']
end

#fetchAccessTokenInstance

Fetch the AccessTokenInstance

Returns:



230
231
232
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 230

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



243
244
245
246
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 243

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

#service_sidString

Returns Verify Service Sid.

Returns:

  • (String)

    Verify Service Sid.



193
194
195
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 193

def service_sid
  @properties['service_sid']
end

#sidString

Returns A string that uniquely identifies this Access Token.

Returns:

  • (String)

    A string that uniquely identifies this Access Token.



181
182
183
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 181

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



236
237
238
239
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 236

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

#tokenString

Returns Generated access token.

Returns:

  • (String)

    Generated access token.



217
218
219
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 217

def token
  @properties['token']
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



223
224
225
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 223

def url
  @properties['url']
end