lib/twilio-ruby/rest/taskrouter/v1/workspace.rb in twilio-ruby-5.0.0.rc9 vs lib/twilio-ruby/rest/taskrouter/v1/workspace.rb in twilio-ruby-5.0.0.rc10
- old
+ new
@@ -10,11 +10,10 @@
class V1 < Version
class WorkspaceList < ListResource
##
# Initialize the WorkspaceList
# @param [Version] version Version that contains the resource
-
# @return [WorkspaceList] WorkspaceList
def initialize(version)
super(version)
# Path Solution
@@ -31,11 +30,10 @@
# guarantees to never return more than limit. Default is no limit
# @param [Integer] page_size Number of records to fetch per request, when 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(friendly_name: nil, limit: nil, page_size: nil)
self.stream(
friendly_name: friendly_name,
limit: limit,
@@ -52,11 +50,10 @@
# guarantees to never return more than limit. Default is no limit
# @param [Integer] page_size Number of records to fetch per request, when 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 [Enumerable] Enumerable that will yield up to limit results
def stream(friendly_name: nil, limit: nil, page_size: nil)
limits = @version.read_limits(limit, page_size)
page = self.page(
@@ -95,11 +92,10 @@
# Request is executed immediately.
# @param [String] friendly_name The friendly_name
# @param [String] page_token PageToken provided by the API
# @param [Integer] page_number Page Number, this value is simply for client state
# @param [Integer] page_size Number of records to return, defaults to 50
-
# @return [Page] Page of WorkspaceInstance
def page(friendly_name: nil, page_token: nil, page_number: nil, page_size: nil)
params = {
'FriendlyName' => friendly_name,
'PageToken' => page_token,
@@ -118,11 +114,10 @@
# Retrieve a single page of WorkspaceInstance records from the API.
# Request is executed immediately.
# @param [String] friendly_name The friendly_name
# @param [String] event_callback_url The event_callback_url
# @param [String] template The template
-
# @return [WorkspaceInstance] Newly created WorkspaceInstance
def create(friendly_name: nil, event_callback_url: nil, template: nil)
data = {
'FriendlyName' => friendly_name,
'EventCallbackUrl' => event_callback_url,
@@ -152,11 +147,10 @@
##
# Initialize the WorkspacePage
# @param [Version] version Version that contains the resource
# @param [Response] response Response from the API
# @param [Hash] solution Path solution for the resource
-
# @return [WorkspacePage] WorkspacePage
def initialize(version, response, solution)
super(version, response)
# Path Solution
@@ -164,11 +158,10 @@
end
##
# Build an instance of WorkspaceInstance
# @param [Hash] payload Payload response from the API
-
# @return [WorkspaceInstance] WorkspaceInstance
def get_instance(payload)
return WorkspaceInstance.new(
@version,
payload,
@@ -185,11 +178,10 @@
class WorkspaceContext < InstanceContext
##
# Initialize the WorkspaceContext
# @param [Version] version Version that contains the resource
# @param [String] sid The sid
-
# @return [WorkspaceContext] WorkspaceContext
def initialize(version, sid)
super(version)
# Path Solution
@@ -221,21 +213,20 @@
)
return WorkspaceInstance.new(
@version,
payload,
- sid: @solution['sid'],
+ sid: @solution[:sid],
)
end
##
# Update the WorkspaceInstance
# @param [String] default_activity_sid The default_activity_sid
# @param [String] event_callback_url The event_callback_url
# @param [String] friendly_name The friendly_name
# @param [String] timeout_activity_sid The timeout_activity_sid
-
# @return [WorkspaceInstance] Updated WorkspaceInstance
def update(default_activity_sid: nil, event_callback_url: nil, friendly_name: nil, timeout_activity_sid: nil)
data = {
'DefaultActivitySid' => default_activity_sid,
'EventCallbackUrl' => event_callback_url,
@@ -250,11 +241,11 @@
)
return WorkspaceInstance.new(
@version,
payload,
- sid: @solution['sid'],
+ sid: @solution[:sid],
)
end
##
# Deletes the WorkspaceInstance
@@ -417,11 +408,10 @@
##
# Initialize the WorkspaceInstance
# @param [Version] version Version that contains the resource
# @param [Hash] payload payload that contains response from Twilio
# @param [String] sid The sid
-
# @return [WorkspaceInstance] WorkspaceInstance
def initialize(version, payload, sid: nil)
super(version)
# Marshaled Properties
@@ -447,11 +437,10 @@
##
# Generate an instance context for the instance, the context is capable of
# performing various actions. All instance actions are proxied to the context
# @param [Version] version Version that contains the resource
-
# @return [WorkspaceContext] WorkspaceContext for this WorkspaceInstance
def context
unless @instance_context
@instance_context = WorkspaceContext.new(
@version,
@@ -503,89 +492,89 @@
##
# Fetch a WorkspaceInstance
# @return [WorkspaceInstance] Fetched WorkspaceInstance
def fetch
- @context.fetch()
+ context.fetch
end
##
# Update the WorkspaceInstance
# @param [String] default_activity_sid The default_activity_sid
# @param [String] event_callback_url The event_callback_url
# @param [String] friendly_name The friendly_name
# @param [String] timeout_activity_sid The timeout_activity_sid
-
# @return [WorkspaceInstance] Updated WorkspaceInstance
def update(default_activity_sid: nil, event_callback_url: nil, friendly_name: nil, timeout_activity_sid: nil)
- @context.update(
+ context.update(
+ default_activity_sid: default_activity_sid,
event_callback_url: event_callback_url,
friendly_name: friendly_name,
timeout_activity_sid: timeout_activity_sid,
)
end
##
# Deletes the WorkspaceInstance
# @return [Boolean] true if delete succeeds, true otherwise
def delete
- @context.delete()
+ context.delete
end
##
# Access the activities
# @return [activities] activities
def activities
- @context.activities
+ context.activities
end
##
# Access the events
# @return [events] events
def events
- @context.events
+ context.events
end
##
# Access the tasks
# @return [tasks] tasks
def tasks
- @context.tasks
+ context.tasks
end
##
# Access the task_queues
# @return [task_queues] task_queues
def task_queues
- @context.task_queues
+ context.task_queues
end
##
# Access the workers
# @return [workers] workers
def workers
- @context.workers
+ context.workers
end
##
# Access the workflows
# @return [workflows] workflows
def workflows
- @context.workflows
+ context.workflows
end
##
# Access the statistics
# @return [statistics] statistics
def statistics
- @context.statistics
+ context.statistics
end
##
# Provide a user friendly representation
def to_s
- context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
- "<Twilio.Taskrouter.V1.WorkspaceInstance #{context}>"
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
+ "<Twilio.Taskrouter.V1.WorkspaceInstance #{values}>"
end
end
end
end
end
\ No newline at end of file