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:

  • version (Version)

    Version that contains the resource

  • account_sid (String)

    The SID of the Account that created the Member resource(s) to update.

  • queue_sid (String)

    The SID of the Queue in which to find the members to update.

  • call_sid (String)

    The Call SID of the resource(s) to update.



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

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:



150
151
152
153
154
155
156
157
158
159
160
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 150

def fetch

    payload = @version.fetch('GET', @uri)
    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



197
198
199
200
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 197

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

#to_sObject

Provide a user friendly representation



190
191
192
193
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 190

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:



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 167

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

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

    payload = @version.update('POST', @uri, data: data)
    MemberInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        queue_sid: @solution[:queue_sid],
        call_sid: @solution[:call_sid],
    )
end