lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb in twilio-ruby-5.0.0.rc9 vs lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb in twilio-ruby-5.0.0.rc10

- old
+ new

@@ -12,11 +12,10 @@ class ActivityList < ListResource ## # Initialize the ActivityList # @param [Version] version Version that contains the resource # @param [String] workspace_sid The workspace_sid - # @return [ActivityList] ActivityList def initialize(version, workspace_sid: nil) super(version) # Path Solution @@ -36,11 +35,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, available: nil, limit: nil, page_size: nil) self.stream( friendly_name: friendly_name, available: available, @@ -59,11 +57,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, available: nil, limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( @@ -105,11 +102,10 @@ # @param [String] friendly_name The friendly_name # @param [String] available The available # @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 ActivityInstance def page(friendly_name: nil, available: nil, page_token: nil, page_number: nil, page_size: nil) params = { 'FriendlyName' => friendly_name, 'Available' => available, @@ -128,11 +124,10 @@ ## # Retrieve a single page of ActivityInstance records from the API. # Request is executed immediately. # @param [String] friendly_name The friendly_name # @param [Boolean] available The available - # @return [ActivityInstance] Newly created ActivityInstance def create(friendly_name: nil, available: nil) data = { 'FriendlyName' => friendly_name, 'Available' => available, @@ -145,11 +140,11 @@ ) return ActivityInstance.new( @version, payload, - workspace_sid: @solution['workspace_sid'], + workspace_sid: @solution[:workspace_sid], ) end ## # Provide a user friendly representation @@ -163,11 +158,10 @@ # Initialize the ActivityPage # @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 workspace_sid - # @return [ActivityPage] ActivityPage def initialize(version, response, solution) super(version, response) # Path Solution @@ -175,17 +169,16 @@ end ## # Build an instance of ActivityInstance # @param [Hash] payload Payload response from the API - # @return [ActivityInstance] ActivityInstance def get_instance(payload) return ActivityInstance.new( @version, payload, - workspace_sid: @solution['workspace_sid'], + workspace_sid: @solution[:workspace_sid], ) end ## # Provide a user friendly representation @@ -198,11 +191,10 @@ ## # Initialize the ActivityContext # @param [Version] version Version that contains the resource # @param [String] workspace_sid The workspace_sid # @param [String] sid The sid - # @return [ActivityContext] ActivityContext def initialize(version, workspace_sid, sid) super(version) # Path Solution @@ -226,19 +218,18 @@ ) return ActivityInstance.new( @version, payload, - workspace_sid: @solution['workspace_sid'], - sid: @solution['sid'], + workspace_sid: @solution[:workspace_sid], + sid: @solution[:sid], ) end ## # Update the ActivityInstance # @param [String] friendly_name The friendly_name - # @return [ActivityInstance] Updated ActivityInstance def update(friendly_name: nil) data = { 'FriendlyName' => friendly_name, } @@ -250,12 +241,12 @@ ) return ActivityInstance.new( @version, payload, - workspace_sid: @solution['workspace_sid'], - sid: @solution['sid'], + workspace_sid: @solution[:workspace_sid], + sid: @solution[:sid], ) end ## # Deletes the ActivityInstance @@ -277,11 +268,10 @@ # Initialize the ActivityInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] workspace_sid The workspace_sid # @param [String] sid The sid - # @return [ActivityInstance] ActivityInstance def initialize(version, payload, workspace_sid: nil, sid: nil) super(version) # Marshaled Properties @@ -305,11 +295,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 [ActivityContext] ActivityContext for this ActivityInstance def context unless @instance_context @instance_context = ActivityContext.new( @version, @@ -350,33 +339,34 @@ ## # Fetch a ActivityInstance # @return [ActivityInstance] Fetched ActivityInstance def fetch - @context.fetch() + context.fetch end ## # Update the ActivityInstance # @param [String] friendly_name The friendly_name - # @return [ActivityInstance] Updated ActivityInstance def update(friendly_name: nil) - @context.update() + context.update( + friendly_name: friendly_name, + ) end ## # Deletes the ActivityInstance # @return [Boolean] true if delete succeeds, true otherwise def delete - @context.delete() + context.delete end ## # Provide a user friendly representation def to_s - context = @params.map{|k, v| "#{k}: #{v}"}.join(" ") - "<Twilio.Taskrouter.V1.ActivityInstance #{context}>" + values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") + "<Twilio.Taskrouter.V1.ActivityInstance #{values}>" end end end end end \ No newline at end of file