Class: Twilio::REST::Api::V2010::AccountContext::QueueContext::MemberContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/queue/member.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, queue_sid, call_sid) ⇒ MemberContext

Initialize the MemberContext

Parameters:



141
142
143
144
145
146
147
148
149
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 141

def initialize(version, , queue_sid, call_sid)
    super(version)

    # Path Solution
    @solution = { account_sid: , queue_sid: queue_sid, call_sid: call_sid,  }
    @uri = "/Accounts/#{@solution[:account_sid]}/Queues/#{@solution[:queue_sid]}/Members/#{@solution[:call_sid]}.json"

    
end

Instance Method Details

#fetchMemberInstance

Fetch the MemberInstance

Returns:



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 153

def fetch

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

#inspectObject

Provide a detailed, user friendly representation



212
213
214
215
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 212

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

#to_sObject

Provide a user friendly representation



205
206
207
208
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 205

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

#update(url: nil, method: :unset) ⇒ MemberInstance

Update the MemberInstance

Parameters:

  • url (String) (defaults to: nil)

    The absolute URL of the Queue resource.

  • method (String) (defaults to: :unset)

    How to pass the update request data. Can be ‘GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters.

Returns:



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 176

def update(
    url: nil, 
    method: :unset
)

    data = Twilio::Values.of({
        'Url' => url,
        'Method' => method,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    MemberInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        queue_sid: @solution[:queue_sid],
        call_sid: @solution[:call_sid],
    )
end