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

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

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.



87
88
89
90
91
92
93
94
95
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 87

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:



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 99

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    AccessTokenInstance.new(
        @version,
        payload,
        service_sid: @solution[:service_sid],
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#to_sObject

Provide a user friendly representation



119
120
121
122
# File 'lib/twilio-ruby/rest/verify/v2/service/access_token.rb', line 119

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