lib/twilio-ruby/rest/conversations/v1/service/conversation.rb in twilio-ruby-6.0.0.pre.rc.1 vs lib/twilio-ruby/rest/conversations/v1/service/conversation.rb in twilio-ruby-6.0.0.pre.rc.2

- old
+ new

@@ -81,39 +81,51 @@ ## # Lists ConversationInstance records from the API as a list. # Unlike stream(), this operation is eager and will load `limit` records into # memory before returning. + # @param [String] start_date Start date in ISO8601 format for sorting and filtering list of Conversations. + # @param [String] end_date End date in ISO8601 format for sorting and filtering list of Conversations. + # @param [State] state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` # @param [Integer] limit Upper limit for the number of records to return. stream() # 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(limit: nil, page_size: nil) + def list(start_date: :unset, end_date: :unset, state: :unset, limit: nil, page_size: nil) self.stream( + start_date: start_date, + end_date: end_date, + state: state, limit: limit, page_size: page_size ).entries end ## # Streams Instance records from the API as an Enumerable. # This operation lazily loads records as efficiently as possible until the limit # is reached. + # @param [String] start_date Start date in ISO8601 format for sorting and filtering list of Conversations. + # @param [String] end_date End date in ISO8601 format for sorting and filtering list of Conversations. + # @param [State] state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` # @param [Integer] limit Upper limit for the number of records to return. stream() # 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(limit: nil, page_size: nil) + def stream(start_date: :unset, end_date: :unset, state: :unset, limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( + start_date: start_date, + end_date: end_date, + state: state, page_size: limits[:page_size], ) @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) end @@ -132,15 +144,24 @@ end ## # Retrieve a single page of ConversationInstance records from the API. # Request is executed immediately. + # @param [String] start_date Start date in ISO8601 format for sorting and filtering list of Conversations. + # @param [String] end_date End date in ISO8601 format for sorting and filtering list of Conversations. + # @param [State] state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` # @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 ConversationInstance - def page(page_token: :unset, page_number: :unset, page_size: :unset) + def page(start_date: :unset, end_date: :unset, state: :unset, page_token: :unset, page_number: :unset, page_size: :unset) params = Twilio::Values.of({ + + 'StartDate' => start_date, + + 'EndDate' => end_date, + + 'State' => state, 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, })