Class: Twilio::REST::Verify::V2::ServiceContext::AccessTokenContext

Inherits:
InstanceContext
  • 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, service_sid, sid) ⇒ AccessTokenContext

Initialize the AccessTokenContext

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String)

    The unique SID identifier of the Service.

  • sid (String)

    A 34 character string that uniquely identifies this Access Token.


103
104
105
106
107
108
109
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 103

def initialize(version, service_sid, sid)
  super(version)

  # Path Solution
  @solution = {service_sid: service_sid, sid: sid, }
  @uri = "/Services/#{@solution[:service_sid]}/AccessTokens/#{@solution[:sid]}"
end

Instance Method Details

#fetchAccessTokenInstance

Fetch the AccessTokenInstance

Returns:


114
115
116
117
118
119
120
121
122
123
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 114

def fetch
  payload = @version.fetch('GET', @uri)

  AccessTokenInstance.new(
      @version,
      payload,
      service_sid: @solution[:service_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


134
135
136
137
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 134

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Verify.V2.AccessTokenContext #{context}>"
end

#to_sObject

Provide a user friendly representation


127
128
129
130
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 127

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Verify.V2.AccessTokenContext #{context}>"
end