lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb in twilio-ruby-5.4.2 vs lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb in twilio-ruby-5.4.3
- old
+ new
@@ -19,14 +19,11 @@
# @return [WorkerChannelList] WorkerChannelList
def initialize(version, workspace_sid: nil, worker_sid: nil)
super(version)
# Path Solution
- @solution = {
- workspace_sid: workspace_sid,
- worker_sid: worker_sid
- }
+ @solution = {workspace_sid: workspace_sid, worker_sid: worker_sid}
@uri = "/Workspaces/#{@solution[:workspace_sid]}/Workers/#{@solution[:worker_sid]}/Channels"
end
##
# Lists WorkerChannelInstance records from the API as a list.
@@ -38,14 +35,11 @@
# not set will use the default value of 50 records. If no page_size is defined
# but a limit is defined, stream() will attempt to read the limit with the most
# efficient page size, i.e. min(limit, 1000)
# @return [Array] Array of up to limit results
def list(limit: nil, page_size: nil)
- self.stream(
- limit: limit,
- page_size: page_size
- ).entries
+ self.stream(limit: limit, page_size: page_size).entries
end
##
# Streams WorkerChannelInstance records from the API as an Enumerable.
# This operation lazily loads records as efficiently as possible until the limit
@@ -58,13 +52,11 @@
# efficient page size, i.e. min(limit, 1000)
# @return [Enumerable] Enumerable that will yield up to limit results
def stream(limit: nil, page_size: nil)
limits = @version.read_limits(limit, page_size)
- page = self.page(
- page_size: limits[:page_size],
- )
+ page = self.page(page_size: limits[:page_size],)
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
end
##
@@ -72,13 +64,11 @@
# This operation lazily loads records as efficiently as possible until the limit
# is reached.
def each
limits = @version.read_limits
- page = self.page(
- page_size: limits[:page_size],
- )
+ page = self.page(page_size: limits[:page_size],)
@version.stream(page,
limit: limits[:limit],
page_limit: limits[:page_limit]).each {|x| yield x}
end
@@ -168,15 +158,11 @@
# @return [WorkerChannelContext] WorkerChannelContext
def initialize(version, workspace_sid, worker_sid, sid)
super(version)
# Path Solution
- @solution = {
- workspace_sid: workspace_sid,
- worker_sid: worker_sid,
- sid: sid,
- }
+ @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
@@ -203,14 +189,11 @@
# Update the WorkerChannelInstance
# @param [String] capacity The capacity
# @param [Boolean] available The available
# @return [WorkerChannelInstance] Updated WorkerChannelInstance
def update(capacity: :unset, available: :unset)
- data = Twilio::Values.of({
- 'Capacity' => capacity,
- 'Available' => available,
- })
+ data = Twilio::Values.of({'Capacity' => capacity, 'Available' => available,})
payload = @version.update(
'POST',
@uri,
data: data,
@@ -383,13 +366,10 @@
# Update the WorkerChannelInstance
# @param [String] capacity The capacity
# @param [Boolean] available The available
# @return [WorkerChannelInstance] Updated WorkerChannelInstance
def update(capacity: :unset, available: :unset)
- context.update(
- capacity: capacity,
- available: available,
- )
+ context.update(capacity: capacity, available: available,)
end
##
# Provide a user friendly representation
def to_s
\ No newline at end of file