lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb in twilio-ruby-5.39.0
- old
+ new
@@ -88,15 +88,13 @@
params = Twilio::Values.of({
'PageToken' => page_token,
'Page' => page_number,
'PageSize' => page_size,
})
- response = @version.page(
- 'GET',
- @uri,
- params
- )
+
+ response = @version.page('GET', @uri, params)
+
WorkerChannelPage.new(@version, response, @solution)
end
##
# Retrieve a single page of WorkerChannelInstance records from the API.
@@ -169,21 +167,15 @@
@solution = {workspace_sid: workspace_sid, worker_sid: worker_sid, sid: sid, }
@uri = "/Workspaces/#{@solution[:workspace_sid]}/Workers/#{@solution[:worker_sid]}/Channels/#{@solution[:sid]}"
end
##
- # Fetch a WorkerChannelInstance
+ # Fetch the WorkerChannelInstance
# @return [WorkerChannelInstance] Fetched WorkerChannelInstance
def fetch
- params = Twilio::Values.of({})
+ payload = @version.fetch('GET', @uri)
- payload = @version.fetch(
- 'GET',
- @uri,
- params,
- )
-
WorkerChannelInstance.new(
@version,
payload,
workspace_sid: @solution[:workspace_sid],
worker_sid: @solution[:worker_sid],
@@ -202,15 +194,11 @@
# type.
# @return [WorkerChannelInstance] Updated WorkerChannelInstance
def update(capacity: :unset, available: :unset)
data = Twilio::Values.of({'Capacity' => capacity, 'Available' => available, })
- payload = @version.update(
- 'POST',
- @uri,
- data: data,
- )
+ payload = @version.update('POST', @uri, data: data)
WorkerChannelInstance.new(
@version,
payload,
workspace_sid: @solution[:workspace_sid],
@@ -367,10 +355,10 @@
def url
@properties['url']
end
##
- # Fetch a WorkerChannelInstance
+ # Fetch the WorkerChannelInstance
# @return [WorkerChannelInstance] Fetched WorkerChannelInstance
def fetch
context.fetch
end
\ No newline at end of file