lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb in twilio-ruby-5.0.0.rc9 vs lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb in twilio-ruby-5.0.0.rc10
- old
+ new
@@ -12,11 +12,10 @@
class EventList < ListResource
##
# Initialize the EventList
# @param [Version] version Version that contains the resource
# @param [String] workspace_sid The sid
-
# @return [EventList] EventList
def initialize(version, workspace_sid: nil)
super(version)
# Path Solution
@@ -43,11 +42,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(end_date: nil, event_type: nil, minutes: nil, reservation_sid: nil, start_date: nil, task_queue_sid: nil, task_sid: nil, worker_sid: nil, workflow_sid: nil, limit: nil, page_size: nil)
self.stream(
end_date: end_date,
event_type: event_type,
@@ -80,11 +78,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(end_date: nil, event_type: nil, minutes: nil, reservation_sid: nil, start_date: nil, task_queue_sid: nil, task_sid: nil, worker_sid: nil, workflow_sid: nil, limit: nil, page_size: nil)
limits = @version.read_limits(limit, page_size)
page = self.page(
@@ -147,11 +144,10 @@
# @param [String] worker_sid The worker_sid
# @param [String] workflow_sid The workflow_sid
# @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 EventInstance
def page(end_date: nil, event_type: nil, minutes: nil, reservation_sid: nil, start_date: nil, task_queue_sid: nil, task_sid: nil, worker_sid: nil, workflow_sid: nil, page_token: nil, page_number: nil, page_size: nil)
params = {
'EndDate' => Twilio.serialize_iso8601(end_date),
'EventType' => event_type,
@@ -186,11 +182,10 @@
# Initialize the EventPage
# @param [Version] version Version that contains the resource
# @param [Response] response Response from the API
# @param [Hash] solution Path solution for the resource
# @param [String] workspace_sid The sid
-
# @return [EventPage] EventPage
def initialize(version, response, solution)
super(version, response)
# Path Solution
@@ -198,17 +193,16 @@
end
##
# Build an instance of EventInstance
# @param [Hash] payload Payload response from the API
-
# @return [EventInstance] EventInstance
def get_instance(payload)
return EventInstance.new(
@version,
payload,
- workspace_sid: @solution['workspace_sid'],
+ workspace_sid: @solution[:workspace_sid],
)
end
##
# Provide a user friendly representation
@@ -221,11 +215,10 @@
##
# Initialize the EventContext
# @param [Version] version Version that contains the resource
# @param [String] workspace_sid The workspace_sid
# @param [String] sid The sid
-
# @return [EventContext] EventContext
def initialize(version, workspace_sid, sid)
super(version)
# Path Solution
@@ -249,12 +242,12 @@
)
return EventInstance.new(
@version,
payload,
- workspace_sid: @solution['workspace_sid'],
- sid: @solution['sid'],
+ workspace_sid: @solution[:workspace_sid],
+ sid: @solution[:sid],
)
end
##
# Provide a user friendly representation
@@ -269,11 +262,10 @@
# Initialize the EventInstance
# @param [Version] version Version that contains the resource
# @param [Hash] payload payload that contains response from Twilio
# @param [String] workspace_sid The sid
# @param [String] sid The sid
-
# @return [EventInstance] EventInstance
def initialize(version, payload, workspace_sid: nil, sid: nil)
super(version)
# Marshaled Properties
@@ -305,11 +297,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 [EventContext] EventContext for this EventInstance
def context
unless @instance_context
@instance_context = EventContext.new(
@version,
@@ -382,17 +373,17 @@
##
# Fetch a EventInstance
# @return [EventInstance] Fetched EventInstance
def fetch
- @context.fetch()
+ context.fetch
end
##
# Provide a user friendly representation
def to_s
- context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
- "<Twilio.Taskrouter.V1.EventInstance #{context}>"
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
+ "<Twilio.Taskrouter.V1.EventInstance #{values}>"
end
end
end
end
end
\ No newline at end of file