lib/twilio-ruby/rest/api/v2010/account/notification.rb in twilio-ruby-5.0.0.rc9 vs lib/twilio-ruby/rest/api/v2010/account/notification.rb in twilio-ruby-5.0.0.rc10

- old
+ new

@@ -13,11 +13,10 @@ ## # Initialize the NotificationList # @param [Version] version Version that contains the resource # @param [String] account_sid The unique id of the Account responsible for this # notification. - # @return [NotificationList] NotificationList def initialize(version, account_sid: nil) super(version) # Path Solution @@ -39,11 +38,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: nil, message_date_before: nil, message_date: nil, message_date_after: nil, limit: nil, page_size: nil) self.stream( log: log, message_date_before: message_date_before, @@ -66,11 +64,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: nil, message_date_before: nil, message_date: nil, message_date_after: nil, limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( @@ -118,11 +115,10 @@ # @param [Time] message_date Filter by date # @param [Time] message_date_after: Filter by 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 NotificationInstance def page(log: nil, message_date_before: nil, message_date: nil, message_date_after: nil, page_token: nil, page_number: nil, page_size: nil) params = { 'Log' => log, 'MessageDate<' => Twilio.serialize_iso8601(message_date_before), @@ -153,11 +149,10 @@ # @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] account_sid The unique id of the Account responsible for this # notification. - # @return [NotificationPage] NotificationPage def initialize(version, response, solution) super(version, response) # Path Solution @@ -165,17 +160,16 @@ end ## # Build an instance of NotificationInstance # @param [Hash] payload Payload response from the API - # @return [NotificationInstance] NotificationInstance def get_instance(payload) return NotificationInstance.new( @version, payload, - account_sid: @solution['account_sid'], + account_sid: @solution[:account_sid], ) end ## # Provide a user friendly representation @@ -188,11 +182,10 @@ ## # Initialize the NotificationContext # @param [Version] version Version that contains the resource # @param [String] account_sid The account_sid # @param [String] sid The notification Sid that uniquely identifies this resource - # @return [NotificationContext] NotificationContext def initialize(version, account_sid, sid) super(version) # Path Solution @@ -216,12 +209,12 @@ ) return NotificationInstance.new( @version, payload, - account_sid: @solution['account_sid'], - sid: @solution['sid'], + account_sid: @solution[:account_sid], + sid: @solution[:sid], ) end ## # Deletes the NotificationInstance @@ -244,11 +237,10 @@ # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] account_sid The unique id of the Account responsible for this # notification. # @param [String] sid The notification Sid that uniquely identifies this resource - # @return [NotificationInstance] NotificationInstance def initialize(version, payload, account_sid: nil, sid: nil) super(version) # Marshaled Properties @@ -282,11 +274,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 [NotificationContext] NotificationContext for this NotificationInstance def context unless @instance_context @instance_context = NotificationContext.new( @version, @@ -367,24 +358,24 @@ ## # Fetch a NotificationInstance # @return [NotificationInstance] Fetched NotificationInstance def fetch - @context.fetch() + context.fetch end ## # Deletes the NotificationInstance # @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.Api.V2010.NotificationInstance #{context}>" + values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") + "<Twilio.Api.V2010.NotificationInstance #{values}>" end end end end end \ No newline at end of file