lib/twilio-ruby/rest/api/v2010/account/message/media.rb in twilio-ruby-5.0.0.rc23 vs lib/twilio-ruby/rest/api/v2010/account/message/media.rb in twilio-ruby-5.0.0.rc24

- old
+ new

@@ -32,57 +32,64 @@ ## # Lists MediaInstance records from the API as a list. # Unlike stream(), this operation is eager and will load `limit` records into # memory before returning. - # @param [Time] date_created Only show media created on the given date, or - # before/after using date inequalities. + # @param [Time] date_created_before Filter by date created + # @param [Time] date_created Filter by date created + # @param [Time] date_created_after: Filter by date created # @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(date_created: :unset, limit: nil, page_size: nil) + def list(date_created_before: :unset, date_created: :unset, date_created_after: :unset, limit: nil, page_size: nil) self.stream( + date_created_before: date_created_before, date_created: date_created, + date_created_after: date_created_after, limit: limit, page_size: page_size ).entries end ## # Streams MediaInstance records from the API as an Enumerable. # This operation lazily loads records as efficiently as possible until the limit # is reached. - # @param [Time] date_created Only show media created on the given date, or - # before/after using date inequalities. + # @param [Time] date_created_before Filter by date created + # @param [Time] date_created Filter by date created + # @param [Time] date_created_after: Filter by date created # @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(date_created: :unset, limit: nil, page_size: nil) + def stream(date_created_before: :unset, date_created: :unset, date_created_after: :unset, limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( + date_created_before: date_created_before, date_created: date_created, + date_created_after: date_created_after, page_size: limits[:page_size], ) @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) end ## # When passed a block, yields MediaInstance records from the API. # This operation lazily loads records as efficiently as possible until the limit # is reached. - # @param [Time] date_created Only show media created on the given date, or - # before/after using date inequalities. + # @param [Time] date_created_before Filter by date created + # @param [Time] date_created Filter by date created + # @param [Time] date_created_after: Filter by date created # @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 @@ -100,18 +107,21 @@ end ## # Retrieve a single page of MediaInstance records from the API. # Request is executed immediately. - # @param [Time] date_created Only show media created on the given date, or - # before/after using date inequalities. + # @param [Time] date_created_before Filter by date created + # @param [Time] date_created Filter by date created + # @param [Time] date_created_after: Filter by date created # @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 MediaInstance - def page(date_created: :unset, page_token: :unset, page_number: :unset, page_size: :unset) + def page(date_created_before: :unset, date_created: :unset, date_created_after: :unset, page_token: :unset, page_number: :unset, page_size: :unset) params = Twilio::Values.of({ - 'DateCreated' => Twilio.serialize_iso8601(date_created), + 'DateCreated<' => Twilio.serialize_iso8601_datetime(date_created_before), + 'DateCreated' => Twilio.serialize_iso8601_datetime(date_created), + 'DateCreated>' => Twilio.serialize_iso8601_datetime(date_created_after), 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, }) response = @version.page( \ No newline at end of file