lib/twilio-ruby/rest/ip_messaging/v1/service.rb in twilio-ruby-5.4.4 vs lib/twilio-ruby/rest/ip_messaging/v1/service.rb in twilio-ruby-5.4.5

- old
+ new

@@ -25,19 +25,19 @@ # Retrieve a single page of ServiceInstance records from the API. # Request is executed immediately. # @param [String] friendly_name The friendly_name # @return [ServiceInstance] Newly created ServiceInstance def create(friendly_name: nil) - data = Twilio::Values.of({'FriendlyName' => friendly_name,}) + data = Twilio::Values.of({'FriendlyName' => friendly_name}) payload = @version.create( 'POST', @uri, data: data ) - ServiceInstance.new(@version, payload,) + ServiceInstance.new(@version, payload) end ## # Lists ServiceInstance records from the API as a list. # Unlike stream(), this operation is eager and will load `limit` records into @@ -65,11 +65,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 ## @@ -77,11 +77,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 @@ -144,11 +144,11 @@ ## # Build an instance of ServiceInstance # @param [Hash] payload Payload response from the API # @return [ServiceInstance] ServiceInstance def get_instance(payload) - ServiceInstance.new(@version, payload,) + ServiceInstance.new(@version, payload) end ## # Provide a user friendly representation def to_s @@ -164,11 +164,11 @@ # @return [ServiceContext] ServiceContext def initialize(version, sid) super(version) # Path Solution - @solution = {sid: sid,} + @solution = {sid: sid} @uri = "/Services/#{@solution[:sid]}" # Dependents @channels = nil @roles = nil @@ -185,11 +185,11 @@ 'GET', @uri, params, ) - ServiceInstance.new(@version, payload, sid: @solution[:sid],) + ServiceInstance.new(@version, payload, sid: @solution[:sid]) end ## # Deletes the ServiceInstance # @return [Boolean] true if delete succeeds, true otherwise @@ -396,26 +396,26 @@ 'POST', @uri, data: data, ) - ServiceInstance.new(@version, payload, sid: @solution[:sid],) + ServiceInstance.new(@version, payload, sid: @solution[:sid]) end ## # Access the channels # @return [ChannelList] # @return [ChannelContext] if sid was passed. def channels(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset - return ChannelContext.new(@version, @solution[:sid], sid,) + return ChannelContext.new(@version, @solution[:sid], sid) end unless @channels - @channels = ChannelList.new(@version, service_sid: @solution[:sid],) + @channels = ChannelList.new(@version, service_sid: @solution[:sid]) end @channels end @@ -425,15 +425,15 @@ # @return [RoleContext] if sid was passed. def roles(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset - return RoleContext.new(@version, @solution[:sid], sid,) + return RoleContext.new(@version, @solution[:sid], sid) end unless @roles - @roles = RoleList.new(@version, service_sid: @solution[:sid],) + @roles = RoleList.new(@version, service_sid: @solution[:sid]) end @roles end @@ -443,15 +443,15 @@ # @return [UserContext] if sid was passed. def users(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset - return UserContext.new(@version, @solution[:sid], sid,) + return UserContext.new(@version, @solution[:sid], sid) end unless @users - @users = UserList.new(@version, service_sid: @solution[:sid],) + @users = UserList.new(@version, service_sid: @solution[:sid]) end @users end @@ -498,19 +498,19 @@ 'links' => payload['links'], } # Context @instance_context = nil - @params = {'sid' => sid || @properties['sid'],} + @params = {'sid' => sid || @properties['sid']} end ## # Generate an instance context for the instance, the context is capable of # performing various actions. All instance actions are proxied to the context # @return [ServiceContext] ServiceContext for this ServiceInstance def context unless @instance_context - @instance_context = ServiceContext.new(@version, @params['sid'],) + @instance_context = ServiceContext.new(@version, @params['sid']) end @instance_context end ## \ No newline at end of file