lib/twilio-ruby/rest/monitor/v1/alert.rb in twilio-ruby-5.0.0.rc9 vs lib/twilio-ruby/rest/monitor/v1/alert.rb in twilio-ruby-5.0.0.rc10

- old
+ new

@@ -10,11 +10,10 @@ class V1 < Version class AlertList < ListResource ## # Initialize the AlertList # @param [Version] version Version that contains the resource - # @return [AlertList] AlertList def initialize(version) super(version) # Path Solution @@ -37,11 +36,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(log_level: nil, start_date_before: nil, start_date: nil, start_date_after: nil, end_date_before: nil, end_date: nil, end_date_after: nil, limit: nil, page_size: nil) self.stream( log_level: log_level, start_date_before: start_date_before, @@ -70,11 +68,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(log_level: nil, start_date_before: nil, start_date: nil, start_date_after: nil, end_date_before: nil, end_date: nil, end_date_after: nil, limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( @@ -131,11 +128,10 @@ # @param [Time] end_date The end_date # @param [Time] end_date_after: The end_date # @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 AlertInstance def page(log_level: nil, start_date_before: nil, start_date: nil, start_date_after: nil, end_date_before: nil, end_date: nil, end_date_after: nil, page_token: nil, page_number: nil, page_size: nil) params = { 'LogLevel' => log_level, 'StartDate<' => Twilio.serialize_iso8601(start_date_before), @@ -167,11 +163,10 @@ ## # Initialize the AlertPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource - # @return [AlertPage] AlertPage def initialize(version, response, solution) super(version, response) # Path Solution @@ -179,11 +174,10 @@ end ## # Build an instance of AlertInstance # @param [Hash] payload Payload response from the API - # @return [AlertInstance] AlertInstance def get_instance(payload) return AlertInstance.new( @version, payload, @@ -200,11 +194,10 @@ class AlertContext < InstanceContext ## # Initialize the AlertContext # @param [Version] version Version that contains the resource # @param [String] sid The sid - # @return [AlertContext] AlertContext def initialize(version, sid) super(version) # Path Solution @@ -227,11 +220,11 @@ ) return AlertInstance.new( @version, payload, - sid: @solution['sid'], + sid: @solution[:sid], ) end ## # Deletes the AlertInstance @@ -252,11 +245,10 @@ ## # Initialize the AlertInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] sid The sid - # @return [AlertInstance] AlertInstance def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @@ -289,11 +281,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 [AlertContext] AlertContext for this AlertInstance def context unless @instance_context @instance_context = AlertContext.new( @version, @@ -373,24 +364,24 @@ ## # Fetch a AlertInstance # @return [AlertInstance] Fetched AlertInstance def fetch - @context.fetch() + context.fetch end ## # Deletes the AlertInstance # @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.Monitor.V1.AlertInstance #{context}>" + values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") + "<Twilio.Monitor.V1.AlertInstance #{values}>" end end end end end \ No newline at end of file