diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c8bcd534..60d0e7a4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,7 +62,7 @@ async fn create_customer(client: &Client) -> Result<(), stripe::Error> { ``` The locations where such a migration is necessary are most easily found due to compiler errors on upgrading. Information -on determining the crate a request lives in can be found in the [README][README.md/Stripe\ Request\ Crates]. The +on determining the crate a request lives in can be found in the [README](README.md#stripe-request-crates). The general steps will be: 1. Find the required crate and feature for the request by [searching here](crate_info.md) 2. Using `Account` and `create` as an example, convert the general structure: @@ -129,7 +129,8 @@ breaking changes we missed here. If so, please open an issue (especially for cha ### Non-breaking Changes - `List<>` types now are paginable. This allows usage such as paginating the external accounts returned as `List` from retrieving an account. -- The `smart-default` dependency was removed +- `SearchList<>` types are now paginable. +- The `smart-default` dependency was removed. # [0.26.0](https://github.com/arlyon/async-stripe/compare/v0.25.2...v0.26.0) (2023-10-31) diff --git a/async-stripe/src/lib.rs b/async-stripe/src/lib.rs index 34958351c..66152d164 100644 --- a/async-stripe/src/lib.rs +++ b/async-stripe/src/lib.rs @@ -59,7 +59,7 @@ mod client; mod error; mod pagination; -pub use pagination::{ListPaginator, PaginationExt, PaginationParams}; +pub use pagination::{ListPaginator, PaginationExt}; pub use stripe_shared::account::AccountId; pub use stripe_shared::application::ApplicationId; pub use stripe_shared::ApiVersion; diff --git a/async-stripe/src/pagination.rs b/async-stripe/src/pagination.rs index b4581bf03..64fe81908 100644 --- a/async-stripe/src/pagination.rs +++ b/async-stripe/src/pagination.rs @@ -1,84 +1,110 @@ // Necessary under tokio-blocking since `Response` is a type alias to a `Result` #![allow(clippy::missing_errors_doc)] -use serde::de::DeserializeOwned; use serde::Serialize; -use stripe_types::{AsCursorOpt, List, Object}; +use stripe_types::{List, PaginableList, SearchList}; -use crate::{Client, Response}; - -/// Should only be implemented by `List*` parameter types. Kept public so that -/// the generated code crates can access this trait. -#[doc(hidden)] -pub trait PaginationParams: Serialize {} +use crate::Client; #[derive(Debug)] pub struct ListPaginator { - data: Vec, - url: String, - has_more: bool, - total_count: Option, + page: T, params: serde_json::Value, } -pub trait PaginationExt { - fn into_paginator(self) -> ListPaginator; +pub trait PaginationExt { + type Data; + + fn into_paginator(self) -> ListPaginator; } -impl PaginationExt for List +impl PaginationExt for List where - T: Object + DeserializeOwned + Send + Sync + 'static, - T::Id: ToString, + T: Sync + Send + 'static, + List: PaginableList, { - fn into_paginator(self) -> ListPaginator { - let mut paginator = ListPaginator { - data: self.data, - // the url we get back is prefixed - url: self.url.trim_start_matches("/v1/").to_string(), - has_more: self.has_more, - total_count: self.total_count, - params: Default::default(), - }; - if let Some(curr_cursor) = paginator.data.last().and_then(|t| t.id().as_cursor_opt()) { - paginator.update_cursor(curr_cursor.to_string()); - } - paginator + type Data = List; + + fn into_paginator(mut self) -> ListPaginator> { + let mut params = Default::default(); + self.update_params(&mut params); + ListPaginator { page: self, params } } } -impl ListPaginator { - /// Kept public so that the generated code crates can access this trait. Used by `List*` params - /// to implement `PaginationExt`. +impl PaginationExt for SearchList +where + T: Sync + Send + 'static, + SearchList: PaginableList, +{ + type Data = SearchList; + + fn into_paginator(mut self) -> ListPaginator> { + let mut params = Default::default(); + self.update_params(&mut params); + ListPaginator { page: self, params } + } +} + +impl ListPaginator> { + /// Kept public so that the generated code crates can access this trait. Used by `Search*` params + /// to implement `PaginationExt`. Not part of the public API. #[doc(hidden)] - pub fn from_params(url: &str, params: impl PaginationParams) -> Self { - ListPaginator { - data: vec![], + pub fn from_search_params(url: &str, params: impl Serialize) -> Self { + let page = SearchList { url: url.to_string(), has_more: true, + data: vec![], + next_page: None, total_count: None, - params: serde_json::to_value(params).expect("Invalid pagination params"), + }; + Self { + page, + params: serde_json::to_value(params) + // Expect should be safe since we control which types call this + .expect("all Stripe types implement `Serialize` infallibly"), + } + } +} + +impl ListPaginator> { + /// Kept public so that the generated code crates can access this trait. Used by `List*` params + /// to implement `PaginationExt`. Not part of the public API. + #[doc(hidden)] + pub fn from_list_params(url: &str, params: impl Serialize) -> Self { + let page = List { data: vec![], has_more: true, total_count: None, url: url.to_string() }; + Self { + page, + params: serde_json::to_value(params) + .expect("all Stripe types implement `Serialize` infallibly"), } } } impl ListPaginator where - T: Object + DeserializeOwned + Send + Sync + 'static, + T: PaginableList + Send + Sync + 'static, { /// Repeatedly queries Stripe for more data until all elements in list are fetched, using /// Stripe's default page size. /// /// Requires `feature = "blocking"`. #[cfg(feature = "blocking")] - pub fn get_all(self, client: &Client) -> Response> { - let mut data = Vec::with_capacity(self.total_count.unwrap_or(0) as usize); - let mut paginator = self; + pub fn get_all(self, client: &Client) -> crate::Response> { + let mut data = vec![]; + let mut parts = self.page.into_parts(); + let mut params = self.params; loop { - if !paginator.has_more { - data.extend(paginator.data); + // `append` empties `parts.data` + data.append(&mut parts.data); + + if !parts.has_more { break; } - let next_page = paginator.fetch_page_with_curr_params(client)?; - paginator.update_with_new_data(next_page); + + let mut next_page: T = + client.get_query(parts.url.trim_start_matches("/v1/"), ¶ms)?; + next_page.update_params(&mut params); + parts = next_page.into_parts(); } Ok(data) } @@ -92,67 +118,59 @@ where /// Requires `feature = ["async", "stream"]`. #[cfg(all(feature = "async", feature = "stream"))] pub fn stream( - mut self, + self, client: &Client, - ) -> impl futures_util::Stream> + Unpin { + ) -> impl futures_util::Stream> + Unpin { // We are going to be popping items off the end of the list, so we need to reverse it. - self.data.reverse(); - - Box::pin(futures_util::stream::unfold(Some((self, client.clone())), Self::unfold_stream)) + let mut page = self.page.into_parts(); + page.data.reverse(); + let paginator = ListPaginator { page: T::from_parts(page), params: self.params }; + + Box::pin(futures_util::stream::unfold( + Some((paginator, client.clone())), + Self::unfold_stream, + )) } /// unfold a single item from the stream #[cfg(all(feature = "async", feature = "stream"))] async fn unfold_stream( state: Option<(Self, Client)>, - ) -> Option<(Result, Option<(Self, Client)>)> { - let (mut paginator, client) = state?; // If none, we sent the last item in the last iteration - - if let Some(next_val) = paginator.data.pop() { + ) -> Option<(Result, Option<(Self, Client)>)> { + let (paginator, client) = state?; // If none, our last request was an error, so stop here + let mut parts = paginator.page.into_parts(); + if let Some(next_val) = parts.data.pop() { // We have more data on this page - return Some((Ok(next_val), Some((paginator, client)))); + return Some(( + Ok(next_val), + Some((Self { page: T::from_parts(parts), params: paginator.params }, client)), + )); } // Final value of the stream, no errors - if !paginator.has_more { + if !parts.has_more { return None; } - match paginator.fetch_page_with_curr_params(&client).await { - Ok(next_page) => { - debug_assert!(paginator.data.is_empty()); - paginator.update_with_new_data(next_page); + match client + .get_query::(parts.url.trim_start_matches("/v1/"), &paginator.params) + .await + { + Ok(mut next_page) => { + let mut params = paginator.params; + next_page.update_params(&mut params); + + let mut parts = next_page.into_parts(); // We are going to be popping items off the end of the list, so we need to reverse it. - // The assert above ensures we are only reversing this specific list we've - // just received - paginator.data.reverse(); + parts.data.reverse(); - let next_val = paginator.data.pop()?; + let next_val = parts.data.pop()?; // Yield last value of this page, the next page (and client) becomes the state - Some((Ok(next_val), Some((paginator, client)))) + Some((Ok(next_val), Some((Self { page: T::from_parts(parts), params }, client)))) } - Err(e) => Some((Err(e), None)), // We ran into an error. The last value of the stream will be the error. - } - } - - fn fetch_page_with_curr_params(&self, client: &Client) -> Response> { - client.get_query(&self.url, &self.params) - } - - fn update_cursor(&mut self, id: String) { - self.params["starting_after"] = serde_json::Value::String(id); - } - - fn update_with_new_data(&mut self, list: List) { - self.has_more = list.has_more; - self.total_count = list.total_count; - if let Some(new_cursor) = list.data.last().and_then(|l| l.id().as_cursor_opt()) { - self.update_cursor(new_cursor.to_string()); - } else { - self.has_more = false; + Err(err) => Some((Err(err), None)), // We ran into an error. The last value of the stream will be the error. } - self.data.extend(list.data); } } diff --git a/generated/stripe_billing/src/billing_portal_configuration/requests.rs b/generated/stripe_billing/src/billing_portal_configuration/requests.rs index 2980be454..9c12149ad 100644 --- a/generated/stripe_billing/src/billing_portal_configuration/requests.rs +++ b/generated/stripe_billing/src/billing_portal_configuration/requests.rs @@ -40,11 +40,12 @@ impl<'a> ListBillingPortalConfiguration<'a> { ) -> stripe::Response> { client.get_query("/billing_portal/configurations", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/billing_portal/configurations", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/billing_portal/configurations", self) } } -impl<'a> stripe::PaginationParams for ListBillingPortalConfiguration<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreateBillingPortalConfiguration<'a> { /// The business information shown to customers in the portal. diff --git a/generated/stripe_billing/src/credit_note/requests.rs b/generated/stripe_billing/src/credit_note/requests.rs index 2018f40e6..793008f1e 100644 --- a/generated/stripe_billing/src/credit_note/requests.rs +++ b/generated/stripe_billing/src/credit_note/requests.rs @@ -616,11 +616,10 @@ impl<'a> ListCreditNote<'a> { ) -> stripe::Response> { client.get_query("/credit_notes", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/credit_notes", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/credit_notes", self) } } -impl<'a> stripe::PaginationParams for ListCreditNote<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct UpdateCreditNote<'a> { /// Specifies which fields in the response should be expanded. @@ -974,8 +973,9 @@ impl<'a> PreviewLinesCreditNote<'a> { ) -> stripe::Response> { client.get_query("/credit_notes/preview/lines", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/credit_notes/preview/lines", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/credit_notes/preview/lines", self) } } -impl<'a> stripe::PaginationParams for PreviewLinesCreditNote<'a> {} diff --git a/generated/stripe_billing/src/credit_note_line_item/requests.rs b/generated/stripe_billing/src/credit_note_line_item/requests.rs index f47925c00..a94506d38 100644 --- a/generated/stripe_billing/src/credit_note_line_item/requests.rs +++ b/generated/stripe_billing/src/credit_note_line_item/requests.rs @@ -40,8 +40,7 @@ impl<'a> ListCreditNoteLineItem<'a> { pub fn paginate( self, credit_note: &stripe_shared::credit_note::CreditNoteId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/credit_notes/{credit_note}/lines"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/credit_notes/{credit_note}/lines"), self) } } -impl<'a> stripe::PaginationParams for ListCreditNoteLineItem<'a> {} diff --git a/generated/stripe_billing/src/invoice/requests.rs b/generated/stripe_billing/src/invoice/requests.rs index 87c96b8ed..0db975783 100644 --- a/generated/stripe_billing/src/invoice/requests.rs +++ b/generated/stripe_billing/src/invoice/requests.rs @@ -37,6 +37,11 @@ impl<'a> SearchInvoice<'a> { ) -> stripe::Response> { client.get_query("/invoices/search", self) } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/invoices/search", self) + } } #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct UpcomingInvoice<'a> { @@ -4485,11 +4490,12 @@ impl<'a> UpcomingLinesInvoice<'a> { ) -> stripe::Response> { client.get_query("/invoices/upcoming/lines", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/invoices/upcoming/lines", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/invoices/upcoming/lines", self) } } -impl<'a> stripe::PaginationParams for UpcomingLinesInvoice<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct CreateInvoice<'a> { /// The account tax IDs associated with the invoice. @@ -6715,11 +6721,10 @@ impl<'a> ListInvoice<'a> { ) -> stripe::Response> { client.get_query("/invoices", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/invoices", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/invoices", self) } } -impl<'a> stripe::PaginationParams for ListInvoice<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveInvoice<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_billing/src/invoice_item/requests.rs b/generated/stripe_billing/src/invoice_item/requests.rs index f8f9ca2c9..4f5f17fa9 100644 --- a/generated/stripe_billing/src/invoice_item/requests.rs +++ b/generated/stripe_billing/src/invoice_item/requests.rs @@ -55,11 +55,10 @@ impl<'a> ListInvoiceItem<'a> { ) -> stripe::Response> { client.get_query("/invoiceitems", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/invoiceitems", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/invoiceitems", self) } } -impl<'a> stripe::PaginationParams for ListInvoiceItem<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreateInvoiceItem<'a> { /// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. diff --git a/generated/stripe_billing/src/invoice_line_item/requests.rs b/generated/stripe_billing/src/invoice_line_item/requests.rs index 65d5debfb..aeeea349d 100644 --- a/generated/stripe_billing/src/invoice_line_item/requests.rs +++ b/generated/stripe_billing/src/invoice_line_item/requests.rs @@ -40,11 +40,10 @@ impl<'a> ListInvoiceLineItem<'a> { pub fn paginate( self, invoice: &stripe_shared::invoice::InvoiceId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/invoices/{invoice}/lines"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/invoices/{invoice}/lines"), self) } } -impl<'a> stripe::PaginationParams for ListInvoiceLineItem<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct UpdateInvoiceLineItem<'a> { /// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. diff --git a/generated/stripe_billing/src/plan/requests.rs b/generated/stripe_billing/src/plan/requests.rs index bf6324492..ed8c9e1fc 100644 --- a/generated/stripe_billing/src/plan/requests.rs +++ b/generated/stripe_billing/src/plan/requests.rs @@ -45,11 +45,10 @@ impl<'a> ListPlan<'a> { ) -> stripe::Response> { client.get_query("/plans", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/plans", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/plans", self) } } -impl<'a> stripe::PaginationParams for ListPlan<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreatePlan<'a> { /// Whether the plan is currently available for new subscriptions. diff --git a/generated/stripe_billing/src/quote/requests.rs b/generated/stripe_billing/src/quote/requests.rs index 0a94197bf..e48b6adb4 100644 --- a/generated/stripe_billing/src/quote/requests.rs +++ b/generated/stripe_billing/src/quote/requests.rs @@ -1167,11 +1167,10 @@ impl<'a> ListQuote<'a> { ) -> stripe::Response> { client.get_query("/quotes", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/quotes", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/quotes", self) } } -impl<'a> stripe::PaginationParams for ListQuote<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct ListLineItemsQuote<'a> { /// A cursor for use in pagination. @@ -1214,11 +1213,10 @@ impl<'a> ListLineItemsQuote<'a> { pub fn paginate( self, quote: &stripe_shared::quote::QuoteId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/quotes/{quote}/line_items"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/quotes/{quote}/line_items"), self) } } -impl<'a> stripe::PaginationParams for ListLineItemsQuote<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct ListComputedUpfrontLineItemsQuote<'a> { /// A cursor for use in pagination. @@ -1261,11 +1259,10 @@ impl<'a> ListComputedUpfrontLineItemsQuote<'a> { pub fn paginate( self, quote: &stripe_shared::quote::QuoteId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params( + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( &format!("/quotes/{quote}/computed_upfront_line_items"), self, ) } } -impl<'a> stripe::PaginationParams for ListComputedUpfrontLineItemsQuote<'a> {} diff --git a/generated/stripe_billing/src/subscription/requests.rs b/generated/stripe_billing/src/subscription/requests.rs index f0d1c3683..47da21f71 100644 --- a/generated/stripe_billing/src/subscription/requests.rs +++ b/generated/stripe_billing/src/subscription/requests.rs @@ -37,6 +37,11 @@ impl<'a> SearchSubscription<'a> { ) -> stripe::Response> { client.get_query("/subscriptions/search", self) } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/subscriptions/search", self) + } } #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct ListSubscription<'a> { @@ -256,11 +261,12 @@ impl<'a> ListSubscription<'a> { ) -> stripe::Response> { client.get_query("/subscriptions", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/subscriptions", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/subscriptions", self) } } -impl<'a> stripe::PaginationParams for ListSubscription<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreateSubscription<'a> { /// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. diff --git a/generated/stripe_billing/src/subscription_item/requests.rs b/generated/stripe_billing/src/subscription_item/requests.rs index 50cb5b6ad..3db435193 100644 --- a/generated/stripe_billing/src/subscription_item/requests.rs +++ b/generated/stripe_billing/src/subscription_item/requests.rs @@ -36,11 +36,12 @@ impl<'a> ListSubscriptionItem<'a> { ) -> stripe::Response> { client.get_query("/subscription_items", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/subscription_items", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/subscription_items", self) } } -impl<'a> stripe::PaginationParams for ListSubscriptionItem<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveSubscriptionItem<'a> { /// Specifies which fields in the response should be expanded. @@ -1003,11 +1004,10 @@ impl<'a> UsageRecordSummariesSubscriptionItem<'a> { pub fn paginate( self, subscription_item: &stripe_shared::subscription_item::SubscriptionItemId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params( + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( &format!("/subscription_items/{subscription_item}/usage_record_summaries"), self, ) } } -impl<'a> stripe::PaginationParams for UsageRecordSummariesSubscriptionItem<'a> {} diff --git a/generated/stripe_billing/src/subscription_schedule/requests.rs b/generated/stripe_billing/src/subscription_schedule/requests.rs index 56932fc1c..e8f32c0b8 100644 --- a/generated/stripe_billing/src/subscription_schedule/requests.rs +++ b/generated/stripe_billing/src/subscription_schedule/requests.rs @@ -52,11 +52,12 @@ impl<'a> ListSubscriptionSchedule<'a> { ) -> stripe::Response> { client.get_query("/subscription_schedules", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/subscription_schedules", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/subscription_schedules", self) } } -impl<'a> stripe::PaginationParams for ListSubscriptionSchedule<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct CreateSubscriptionSchedule<'a> { /// The identifier of the customer to create the subscription schedule for. diff --git a/generated/stripe_billing/src/tax_id/requests.rs b/generated/stripe_billing/src/tax_id/requests.rs index 917bd9bcd..b4e6480c0 100644 --- a/generated/stripe_billing/src/tax_id/requests.rs +++ b/generated/stripe_billing/src/tax_id/requests.rs @@ -333,11 +333,10 @@ impl<'a> ListTaxId<'a> { pub fn paginate( self, customer: &stripe_shared::customer::CustomerId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/customers/{customer}/tax_ids"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/customers/{customer}/tax_ids"), self) } } -impl<'a> stripe::PaginationParams for ListTaxId<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct DeleteTaxId {} impl DeleteTaxId { diff --git a/generated/stripe_billing/src/test_helpers_test_clock/requests.rs b/generated/stripe_billing/src/test_helpers_test_clock/requests.rs index 02c705fe9..8da4abd26 100644 --- a/generated/stripe_billing/src/test_helpers_test_clock/requests.rs +++ b/generated/stripe_billing/src/test_helpers_test_clock/requests.rs @@ -134,8 +134,9 @@ impl<'a> ListTestHelpersTestClock<'a> { ) -> stripe::Response> { client.get_query("/test_helpers/test_clocks", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/test_helpers/test_clocks", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/test_helpers/test_clocks", self) } } -impl<'a> stripe::PaginationParams for ListTestHelpersTestClock<'a> {} diff --git a/generated/stripe_billing/src/usage_record_summary/requests.rs b/generated/stripe_billing/src/usage_record_summary/requests.rs index f934bfe6a..282b844a6 100644 --- a/generated/stripe_billing/src/usage_record_summary/requests.rs +++ b/generated/stripe_billing/src/usage_record_summary/requests.rs @@ -45,11 +45,10 @@ impl<'a> ListUsageRecordSummary<'a> { pub fn paginate( self, subscription_item: &stripe_shared::subscription_item::SubscriptionItemId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params( + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( &format!("/subscription_items/{subscription_item}/usage_record_summaries"), self, ) } } -impl<'a> stripe::PaginationParams for ListUsageRecordSummary<'a> {} diff --git a/generated/stripe_checkout/src/checkout_session/requests.rs b/generated/stripe_checkout/src/checkout_session/requests.rs index 797d93df0..5b1b238d0 100644 --- a/generated/stripe_checkout/src/checkout_session/requests.rs +++ b/generated/stripe_checkout/src/checkout_session/requests.rs @@ -117,11 +117,12 @@ impl<'a> ListCheckoutSession<'a> { ) -> stripe::Response> { client.get_query("/checkout/sessions", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/checkout/sessions", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/checkout/sessions", self) } } -impl<'a> stripe::PaginationParams for ListCheckoutSession<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveCheckoutSession<'a> { /// Specifies which fields in the response should be expanded. @@ -7159,14 +7160,13 @@ impl<'a> ListLineItemsCheckoutSession<'a> { pub fn paginate( self, session: &stripe_checkout::checkout_session::CheckoutSessionId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params( + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( &format!("/checkout/sessions/{session}/line_items"), self, ) } } -impl<'a> stripe::PaginationParams for ListLineItemsCheckoutSession<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct ExpireCheckoutSession<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_connect/src/account/requests.rs b/generated/stripe_connect/src/account/requests.rs index ad0b77c21..eff23105f 100644 --- a/generated/stripe_connect/src/account/requests.rs +++ b/generated/stripe_connect/src/account/requests.rs @@ -2185,11 +2185,10 @@ impl<'a> ListAccount<'a> { ) -> stripe::Response> { client.get_query("/accounts", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/accounts", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/accounts", self) } } -impl<'a> stripe::PaginationParams for ListAccount<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct CreateAccount<'a> { /// An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. @@ -4484,11 +4483,10 @@ impl<'a> PersonsAccount<'a> { pub fn paginate( self, account: &stripe_shared::account::AccountId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/accounts/{account}/persons"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/accounts/{account}/persons"), self) } } -impl<'a> stripe::PaginationParams for PersonsAccount<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct CapabilitiesAccount<'a> { /// Specifies which fields in the response should be expanded. @@ -4514,8 +4512,7 @@ impl<'a> CapabilitiesAccount<'a> { pub fn paginate( self, account: &stripe_shared::account::AccountId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/accounts/{account}/capabilities"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/accounts/{account}/capabilities"), self) } } -impl<'a> stripe::PaginationParams for CapabilitiesAccount<'a> {} diff --git a/generated/stripe_connect/src/application_fee/requests.rs b/generated/stripe_connect/src/application_fee/requests.rs index b1c44eb27..2809c0f58 100644 --- a/generated/stripe_connect/src/application_fee/requests.rs +++ b/generated/stripe_connect/src/application_fee/requests.rs @@ -41,11 +41,12 @@ impl<'a> ListApplicationFee<'a> { ) -> stripe::Response> { client.get_query("/application_fees", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/application_fees", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/application_fees", self) } } -impl<'a> stripe::PaginationParams for ListApplicationFee<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveApplicationFee<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_connect/src/application_fee_refund/requests.rs b/generated/stripe_connect/src/application_fee_refund/requests.rs index 2d7e1f297..b83e2488e 100644 --- a/generated/stripe_connect/src/application_fee_refund/requests.rs +++ b/generated/stripe_connect/src/application_fee_refund/requests.rs @@ -82,11 +82,10 @@ impl<'a> ListApplicationFeeRefund<'a> { pub fn paginate( self, id: &stripe_shared::application_fee::ApplicationFeeId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/application_fees/{id}/refunds"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/application_fees/{id}/refunds"), self) } } -impl<'a> stripe::PaginationParams for ListApplicationFeeRefund<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveApplicationFeeRefund<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_connect/src/apps_secret/requests.rs b/generated/stripe_connect/src/apps_secret/requests.rs index 567d3e0e1..98e574e06 100644 --- a/generated/stripe_connect/src/apps_secret/requests.rs +++ b/generated/stripe_connect/src/apps_secret/requests.rs @@ -392,8 +392,7 @@ impl<'a> ListAppsSecret<'a> { ) -> stripe::Response> { client.get_query("/apps/secrets", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/apps/secrets", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/apps/secrets", self) } } -impl<'a> stripe::PaginationParams for ListAppsSecret<'a> {} diff --git a/generated/stripe_connect/src/capability/requests.rs b/generated/stripe_connect/src/capability/requests.rs index 88dee95e8..00206aad0 100644 --- a/generated/stripe_connect/src/capability/requests.rs +++ b/generated/stripe_connect/src/capability/requests.rs @@ -23,11 +23,10 @@ impl<'a> ListCapability<'a> { pub fn paginate( self, account: &stripe_shared::account::AccountId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/accounts/{account}/capabilities"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/accounts/{account}/capabilities"), self) } } -impl<'a> stripe::PaginationParams for ListCapability<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveCapability<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_connect/src/country_spec/requests.rs b/generated/stripe_connect/src/country_spec/requests.rs index 015b87693..2f9fbb398 100644 --- a/generated/stripe_connect/src/country_spec/requests.rs +++ b/generated/stripe_connect/src/country_spec/requests.rs @@ -34,11 +34,12 @@ impl<'a> ListCountrySpec<'a> { ) -> stripe::Response> { client.get_query("/country_specs", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/country_specs", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/country_specs", self) } } -impl<'a> stripe::PaginationParams for ListCountrySpec<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveCountrySpec<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_connect/src/external_account/requests.rs b/generated/stripe_connect/src/external_account/requests.rs index 20ba7aa91..52a1dedee 100644 --- a/generated/stripe_connect/src/external_account/requests.rs +++ b/generated/stripe_connect/src/external_account/requests.rs @@ -92,11 +92,13 @@ impl<'a> ListExternalAccount<'a> { pub fn paginate( self, account: &stripe_shared::account::AccountId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/accounts/{account}/external_accounts"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/accounts/{account}/external_accounts"), + self, + ) } } -impl<'a> stripe::PaginationParams for ListExternalAccount<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveExternalAccount<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_connect/src/person/requests.rs b/generated/stripe_connect/src/person/requests.rs index a97e973e9..c35ec701c 100644 --- a/generated/stripe_connect/src/person/requests.rs +++ b/generated/stripe_connect/src/person/requests.rs @@ -67,11 +67,10 @@ impl<'a> ListPerson<'a> { pub fn paginate( self, account: &stripe_shared::account::AccountId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/accounts/{account}/persons"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/accounts/{account}/persons"), self) } } -impl<'a> stripe::PaginationParams for ListPerson<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrievePerson<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_connect/src/topup/requests.rs b/generated/stripe_connect/src/topup/requests.rs index b6d2df537..5ce4094dd 100644 --- a/generated/stripe_connect/src/topup/requests.rs +++ b/generated/stripe_connect/src/topup/requests.rs @@ -164,11 +164,10 @@ impl<'a> ListTopup<'a> { ) -> stripe::Response> { client.get_query("/topups", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/topups", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/topups", self) } } -impl<'a> stripe::PaginationParams for ListTopup<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveTopup<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_connect/src/transfer/requests.rs b/generated/stripe_connect/src/transfer/requests.rs index f6a43ae31..ff5ac6f31 100644 --- a/generated/stripe_connect/src/transfer/requests.rs +++ b/generated/stripe_connect/src/transfer/requests.rs @@ -168,11 +168,10 @@ impl<'a> ListTransfer<'a> { ) -> stripe::Response> { client.get_query("/transfers", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/transfers", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/transfers", self) } } -impl<'a> stripe::PaginationParams for ListTransfer<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveTransfer<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_connect/src/transfer_reversal/requests.rs b/generated/stripe_connect/src/transfer_reversal/requests.rs index 849b31761..0a89172cb 100644 --- a/generated/stripe_connect/src/transfer_reversal/requests.rs +++ b/generated/stripe_connect/src/transfer_reversal/requests.rs @@ -93,11 +93,10 @@ impl<'a> ListTransferReversal<'a> { pub fn paginate( self, id: &stripe_shared::transfer::TransferId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/transfers/{id}/reversals"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/transfers/{id}/reversals"), self) } } -impl<'a> stripe::PaginationParams for ListTransferReversal<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveTransferReversal<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_core/src/balance_transaction/requests.rs b/generated/stripe_core/src/balance_transaction/requests.rs index f19232c96..a45fbc0ba 100644 --- a/generated/stripe_core/src/balance_transaction/requests.rs +++ b/generated/stripe_core/src/balance_transaction/requests.rs @@ -56,11 +56,12 @@ impl<'a> ListBalanceTransaction<'a> { ) -> stripe::Response> { client.get_query("/balance_transactions", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/balance_transactions", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/balance_transactions", self) } } -impl<'a> stripe::PaginationParams for ListBalanceTransaction<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveBalanceTransaction<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_core/src/charge/requests.rs b/generated/stripe_core/src/charge/requests.rs index 4e934431e..1fd942adf 100644 --- a/generated/stripe_core/src/charge/requests.rs +++ b/generated/stripe_core/src/charge/requests.rs @@ -37,6 +37,11 @@ impl<'a> SearchCharge<'a> { ) -> stripe::Response> { client.get_query("/charges/search", self) } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/charges/search", self) + } } #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct ListCharge<'a> { @@ -87,11 +92,10 @@ impl<'a> ListCharge<'a> { ) -> stripe::Response> { client.get_query("/charges", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/charges", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/charges", self) } } -impl<'a> stripe::PaginationParams for ListCharge<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct CreateCharge<'a> { /// Amount intended to be collected by this payment. diff --git a/generated/stripe_core/src/customer/requests.rs b/generated/stripe_core/src/customer/requests.rs index 8ac5b168e..e25d05583 100644 --- a/generated/stripe_core/src/customer/requests.rs +++ b/generated/stripe_core/src/customer/requests.rs @@ -37,6 +37,11 @@ impl<'a> SearchCustomer<'a> { ) -> stripe::Response> { client.get_query("/customers/search", self) } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/customers/search", self) + } } #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct ListCustomer<'a> { @@ -88,11 +93,10 @@ impl<'a> ListCustomer<'a> { ) -> stripe::Response> { client.get_query("/customers", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/customers", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/customers", self) } } -impl<'a> stripe::PaginationParams for ListCustomer<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct CreateCustomer<'a> { /// The customer's address. @@ -1491,11 +1495,13 @@ impl<'a> ListPaymentMethodsCustomer<'a> { pub fn paginate( self, customer: &stripe_shared::customer::CustomerId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/customers/{customer}/payment_methods"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/customers/{customer}/payment_methods"), + self, + ) } } -impl<'a> stripe::PaginationParams for ListPaymentMethodsCustomer<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrievePaymentMethodCustomer<'a> { /// Specifies which fields in the response should be expanded. @@ -1558,14 +1564,13 @@ impl<'a> BalanceTransactionsCustomer<'a> { pub fn paginate( self, customer: &stripe_shared::customer::CustomerId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params( + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( &format!("/customers/{customer}/balance_transactions"), self, ) } } -impl<'a> stripe::PaginationParams for BalanceTransactionsCustomer<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct FundCashBalanceCustomer<'a> { /// Amount to be used for this test cash balance transaction. diff --git a/generated/stripe_core/src/customer_balance_transaction/requests.rs b/generated/stripe_core/src/customer_balance_transaction/requests.rs index 2a828cc1f..496cb2988 100644 --- a/generated/stripe_core/src/customer_balance_transaction/requests.rs +++ b/generated/stripe_core/src/customer_balance_transaction/requests.rs @@ -60,14 +60,13 @@ impl<'a> ListCustomerBalanceTransaction<'a> { pub fn paginate( self, customer: &stripe_shared::customer::CustomerId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params( + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( &format!("/customers/{customer}/balance_transactions"), self, ) } } -impl<'a> stripe::PaginationParams for ListCustomerBalanceTransaction<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreateCustomerBalanceTransaction<'a> { /// The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. diff --git a/generated/stripe_core/src/customer_cash_balance_transaction/requests.rs b/generated/stripe_core/src/customer_cash_balance_transaction/requests.rs index 3baa74597..367b7fde8 100644 --- a/generated/stripe_core/src/customer_cash_balance_transaction/requests.rs +++ b/generated/stripe_core/src/customer_cash_balance_transaction/requests.rs @@ -63,11 +63,11 @@ impl<'a> ListCustomerCashBalanceTransaction<'a> { pub fn paginate( self, customer: &stripe_shared::customer::CustomerId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params( + ) -> stripe::ListPaginator> + { + stripe::ListPaginator::from_list_params( &format!("/customers/{customer}/cash_balance_transactions"), self, ) } } -impl<'a> stripe::PaginationParams for ListCustomerCashBalanceTransaction<'a> {} diff --git a/generated/stripe_core/src/dispute/requests.rs b/generated/stripe_core/src/dispute/requests.rs index 553c0b35f..714a0b466 100644 --- a/generated/stripe_core/src/dispute/requests.rs +++ b/generated/stripe_core/src/dispute/requests.rs @@ -42,11 +42,10 @@ impl<'a> ListDispute<'a> { ) -> stripe::Response> { client.get_query("/disputes", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/disputes", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/disputes", self) } } -impl<'a> stripe::PaginationParams for ListDispute<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveDispute<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_core/src/event/requests.rs b/generated/stripe_core/src/event/requests.rs index af92d1516..fa985beba 100644 --- a/generated/stripe_core/src/event/requests.rs +++ b/generated/stripe_core/src/event/requests.rs @@ -55,11 +55,10 @@ impl<'a> ListEvent<'a> { ) -> stripe::Response> { client.get_query("/events", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/events", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/events", self) } } -impl<'a> stripe::PaginationParams for ListEvent<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveEvent<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_core/src/file/requests.rs b/generated/stripe_core/src/file/requests.rs index 0ac839a49..29e3c0953 100644 --- a/generated/stripe_core/src/file/requests.rs +++ b/generated/stripe_core/src/file/requests.rs @@ -139,11 +139,10 @@ impl<'a> ListFile<'a> { ) -> stripe::Response> { client.get_query("/files", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/files", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/files", self) } } -impl<'a> stripe::PaginationParams for ListFile<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveFile<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_core/src/file_link/requests.rs b/generated/stripe_core/src/file_link/requests.rs index f66da4d4f..1d052f512 100644 --- a/generated/stripe_core/src/file_link/requests.rs +++ b/generated/stripe_core/src/file_link/requests.rs @@ -136,8 +136,7 @@ impl<'a> ListFileLink<'a> { ) -> stripe::Response> { client.get_query("/file_links", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/file_links", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/file_links", self) } } -impl<'a> stripe::PaginationParams for ListFileLink<'a> {} diff --git a/generated/stripe_core/src/payment_intent/requests.rs b/generated/stripe_core/src/payment_intent/requests.rs index e40d03b1d..a52adf690 100644 --- a/generated/stripe_core/src/payment_intent/requests.rs +++ b/generated/stripe_core/src/payment_intent/requests.rs @@ -37,6 +37,11 @@ impl<'a> SearchPaymentIntent<'a> { ) -> stripe::Response> { client.get_query("/payment_intents/search", self) } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/payment_intents/search", self) + } } #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreatePaymentIntent<'a> { @@ -6825,11 +6830,12 @@ impl<'a> ListPaymentIntent<'a> { ) -> stripe::Response> { client.get_query("/payment_intents", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/payment_intents", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/payment_intents", self) } } -impl<'a> stripe::PaginationParams for ListPaymentIntent<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrievePaymentIntent<'a> { /// The client secret of the PaymentIntent. diff --git a/generated/stripe_core/src/payment_source/requests.rs b/generated/stripe_core/src/payment_source/requests.rs index 56ee7684c..30a1c9666 100644 --- a/generated/stripe_core/src/payment_source/requests.rs +++ b/generated/stripe_core/src/payment_source/requests.rs @@ -41,11 +41,10 @@ impl<'a> ListPaymentSource<'a> { pub fn paginate( self, customer: &stripe_shared::customer::CustomerId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/customers/{customer}/sources"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/customers/{customer}/sources"), self) } } -impl<'a> stripe::PaginationParams for ListPaymentSource<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrievePaymentSource<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_core/src/payout/requests.rs b/generated/stripe_core/src/payout/requests.rs index 658a4568f..3a0b77ac5 100644 --- a/generated/stripe_core/src/payout/requests.rs +++ b/generated/stripe_core/src/payout/requests.rs @@ -70,11 +70,10 @@ impl<'a> ListPayout<'a> { ) -> stripe::Response> { client.get_query("/payouts", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/payouts", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/payouts", self) } } -impl<'a> stripe::PaginationParams for ListPayout<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreatePayout<'a> { /// A positive integer in cents representing how much to payout. diff --git a/generated/stripe_core/src/refund/requests.rs b/generated/stripe_core/src/refund/requests.rs index b5924c63b..3a2b83be6 100644 --- a/generated/stripe_core/src/refund/requests.rs +++ b/generated/stripe_core/src/refund/requests.rs @@ -44,11 +44,10 @@ impl<'a> ListRefund<'a> { ) -> stripe::Response> { client.get_query("/refunds", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/refunds", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/refunds", self) } } -impl<'a> stripe::PaginationParams for ListRefund<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct CreateRefund<'a> { #[serde(skip_serializing_if = "Option::is_none")] diff --git a/generated/stripe_core/src/setup_attempt/requests.rs b/generated/stripe_core/src/setup_attempt/requests.rs index 743a9945e..44d4710b7 100644 --- a/generated/stripe_core/src/setup_attempt/requests.rs +++ b/generated/stripe_core/src/setup_attempt/requests.rs @@ -49,8 +49,9 @@ impl<'a> ListSetupAttempt<'a> { ) -> stripe::Response> { client.get_query("/setup_attempts", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/setup_attempts", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/setup_attempts", self) } } -impl<'a> stripe::PaginationParams for ListSetupAttempt<'a> {} diff --git a/generated/stripe_core/src/setup_intent/requests.rs b/generated/stripe_core/src/setup_intent/requests.rs index b1e13d601..e6234bd5f 100644 --- a/generated/stripe_core/src/setup_intent/requests.rs +++ b/generated/stripe_core/src/setup_intent/requests.rs @@ -2796,11 +2796,10 @@ impl<'a> ListSetupIntent<'a> { ) -> stripe::Response> { client.get_query("/setup_intents", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/setup_intents", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/setup_intents", self) } } -impl<'a> stripe::PaginationParams for ListSetupIntent<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveSetupIntent<'a> { /// The client secret of the SetupIntent. diff --git a/generated/stripe_fraud/src/radar_early_fraud_warning/requests.rs b/generated/stripe_fraud/src/radar_early_fraud_warning/requests.rs index 68b6f8db6..4580b3a60 100644 --- a/generated/stripe_fraud/src/radar_early_fraud_warning/requests.rs +++ b/generated/stripe_fraud/src/radar_early_fraud_warning/requests.rs @@ -40,11 +40,12 @@ impl<'a> ListRadarEarlyFraudWarning<'a> { ) -> stripe::Response> { client.get_query("/radar/early_fraud_warnings", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/radar/early_fraud_warnings", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/radar/early_fraud_warnings", self) } } -impl<'a> stripe::PaginationParams for ListRadarEarlyFraudWarning<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveRadarEarlyFraudWarning<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_fraud/src/radar_value_list/requests.rs b/generated/stripe_fraud/src/radar_value_list/requests.rs index 086ffafad..b2eef296b 100644 --- a/generated/stripe_fraud/src/radar_value_list/requests.rs +++ b/generated/stripe_fraud/src/radar_value_list/requests.rs @@ -44,11 +44,12 @@ impl<'a> ListRadarValueList<'a> { ) -> stripe::Response> { client.get_query("/radar/value_lists", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/radar/value_lists", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/radar/value_lists", self) } } -impl<'a> stripe::PaginationParams for ListRadarValueList<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveRadarValueList<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_fraud/src/radar_value_list_item/requests.rs b/generated/stripe_fraud/src/radar_value_list_item/requests.rs index 16bc54f00..95cf778f2 100644 --- a/generated/stripe_fraud/src/radar_value_list_item/requests.rs +++ b/generated/stripe_fraud/src/radar_value_list_item/requests.rs @@ -51,11 +51,12 @@ impl<'a> ListRadarValueListItem<'a> { ) -> stripe::Response> { client.get_query("/radar/value_list_items", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/radar/value_list_items", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/radar/value_list_items", self) } } -impl<'a> stripe::PaginationParams for ListRadarValueListItem<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveRadarValueListItem<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_fraud/src/review/requests.rs b/generated/stripe_fraud/src/review/requests.rs index 61f1b3999..5fe2a8bd9 100644 --- a/generated/stripe_fraud/src/review/requests.rs +++ b/generated/stripe_fraud/src/review/requests.rs @@ -38,11 +38,10 @@ impl<'a> ListReview<'a> { ) -> stripe::Response> { client.get_query("/reviews", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/reviews", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/reviews", self) } } -impl<'a> stripe::PaginationParams for ListReview<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveReview<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_issuing/src/issuing_authorization/requests.rs b/generated/stripe_issuing/src/issuing_authorization/requests.rs index 2a0ec0d7c..cfebd3b86 100644 --- a/generated/stripe_issuing/src/issuing_authorization/requests.rs +++ b/generated/stripe_issuing/src/issuing_authorization/requests.rs @@ -106,11 +106,12 @@ impl<'a> ListIssuingAuthorization<'a> { ) -> stripe::Response> { client.get_query("/issuing/authorizations", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/issuing/authorizations", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/issuing/authorizations", self) } } -impl<'a> stripe::PaginationParams for ListIssuingAuthorization<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveIssuingAuthorization<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_issuing/src/issuing_card/requests.rs b/generated/stripe_issuing/src/issuing_card/requests.rs index c9dab8a89..5c04e4ad1 100644 --- a/generated/stripe_issuing/src/issuing_card/requests.rs +++ b/generated/stripe_issuing/src/issuing_card/requests.rs @@ -171,11 +171,10 @@ impl<'a> ListIssuingCard<'a> { ) -> stripe::Response> { client.get_query("/issuing/cards", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/issuing/cards", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/issuing/cards", self) } } -impl<'a> stripe::PaginationParams for ListIssuingCard<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreateIssuingCard<'a> { /// The [Cardholder](https://stripe.com/docs/api#issuing_cardholder_object) object with which the card will be associated. diff --git a/generated/stripe_issuing/src/issuing_cardholder/requests.rs b/generated/stripe_issuing/src/issuing_cardholder/requests.rs index 38ca2461f..ff6c673f0 100644 --- a/generated/stripe_issuing/src/issuing_cardholder/requests.rs +++ b/generated/stripe_issuing/src/issuing_cardholder/requests.rs @@ -165,11 +165,12 @@ impl<'a> ListIssuingCardholder<'a> { ) -> stripe::Response> { client.get_query("/issuing/cardholders", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/issuing/cardholders", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/issuing/cardholders", self) } } -impl<'a> stripe::PaginationParams for ListIssuingCardholder<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreateIssuingCardholder<'a> { /// The cardholder's billing address. diff --git a/generated/stripe_issuing/src/issuing_dispute/requests.rs b/generated/stripe_issuing/src/issuing_dispute/requests.rs index 24296a437..908a9b434 100644 --- a/generated/stripe_issuing/src/issuing_dispute/requests.rs +++ b/generated/stripe_issuing/src/issuing_dispute/requests.rs @@ -105,11 +105,12 @@ impl<'a> ListIssuingDispute<'a> { ) -> stripe::Response> { client.get_query("/issuing/disputes", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/issuing/disputes", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/issuing/disputes", self) } } -impl<'a> stripe::PaginationParams for ListIssuingDispute<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct CreateIssuingDispute<'a> { /// The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). diff --git a/generated/stripe_issuing/src/issuing_token/requests.rs b/generated/stripe_issuing/src/issuing_token/requests.rs index 8115e6616..569d74625 100644 --- a/generated/stripe_issuing/src/issuing_token/requests.rs +++ b/generated/stripe_issuing/src/issuing_token/requests.rs @@ -107,11 +107,12 @@ impl<'a> ListIssuingToken<'a> { ) -> stripe::Response> { client.get_query("/issuing/tokens", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/issuing/tokens", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/issuing/tokens", self) } } -impl<'a> stripe::PaginationParams for ListIssuingToken<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveIssuingToken<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_issuing/src/issuing_transaction/requests.rs b/generated/stripe_issuing/src/issuing_transaction/requests.rs index 9f8f1a650..bba7446e0 100644 --- a/generated/stripe_issuing/src/issuing_transaction/requests.rs +++ b/generated/stripe_issuing/src/issuing_transaction/requests.rs @@ -104,11 +104,12 @@ impl<'a> ListIssuingTransaction<'a> { ) -> stripe::Response> { client.get_query("/issuing/transactions", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/issuing/transactions", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/issuing/transactions", self) } } -impl<'a> stripe::PaginationParams for ListIssuingTransaction<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveIssuingTransaction<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_misc/src/apple_pay_domain/requests.rs b/generated/stripe_misc/src/apple_pay_domain/requests.rs index 869892055..f85332370 100644 --- a/generated/stripe_misc/src/apple_pay_domain/requests.rs +++ b/generated/stripe_misc/src/apple_pay_domain/requests.rs @@ -36,11 +36,12 @@ impl<'a> ListApplePayDomain<'a> { ) -> stripe::Response> { client.get_query("/apple_pay/domains", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/apple_pay/domains", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/apple_pay/domains", self) } } -impl<'a> stripe::PaginationParams for ListApplePayDomain<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreateApplePayDomain<'a> { pub domain_name: &'a str, diff --git a/generated/stripe_misc/src/exchange_rate/requests.rs b/generated/stripe_misc/src/exchange_rate/requests.rs index 4bc088832..805fd7d18 100644 --- a/generated/stripe_misc/src/exchange_rate/requests.rs +++ b/generated/stripe_misc/src/exchange_rate/requests.rs @@ -36,11 +36,10 @@ impl<'a> ListExchangeRate<'a> { ) -> stripe::Response> { client.get_query("/exchange_rates", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/exchange_rates", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/exchange_rates", self) } } -impl<'a> stripe::PaginationParams for ListExchangeRate<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveExchangeRate<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_misc/src/financial_connections_account/requests.rs b/generated/stripe_misc/src/financial_connections_account/requests.rs index 6c806d638..f6ce5e223 100644 --- a/generated/stripe_misc/src/financial_connections_account/requests.rs +++ b/generated/stripe_misc/src/financial_connections_account/requests.rs @@ -59,11 +59,12 @@ impl<'a> ListFinancialConnectionsAccount<'a> { ) -> stripe::Response> { client.get_query("/financial_connections/accounts", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/financial_connections/accounts", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/financial_connections/accounts", self) } } -impl<'a> stripe::PaginationParams for ListFinancialConnectionsAccount<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveFinancialConnectionsAccount<'a> { /// Specifies which fields in the response should be expanded. @@ -127,14 +128,14 @@ impl<'a> ListOwnersFinancialConnectionsAccount<'a> { pub fn paginate( self, account: &stripe_misc::financial_connections_account::FinancialConnectionsAccountId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params( + ) -> stripe::ListPaginator> + { + stripe::ListPaginator::from_list_params( &format!("/financial_connections/accounts/{account}/owners"), self, ) } } -impl<'a> stripe::PaginationParams for ListOwnersFinancialConnectionsAccount<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct RefreshFinancialConnectionsAccount<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_misc/src/identity_verification_report/requests.rs b/generated/stripe_misc/src/identity_verification_report/requests.rs index 6bf097c3e..3af571cab 100644 --- a/generated/stripe_misc/src/identity_verification_report/requests.rs +++ b/generated/stripe_misc/src/identity_verification_report/requests.rs @@ -117,8 +117,9 @@ impl<'a> ListIdentityVerificationReport<'a> { ) -> stripe::Response> { client.get_query("/identity/verification_reports", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/identity/verification_reports", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/identity/verification_reports", self) } } -impl<'a> stripe::PaginationParams for ListIdentityVerificationReport<'a> {} diff --git a/generated/stripe_misc/src/identity_verification_session/requests.rs b/generated/stripe_misc/src/identity_verification_session/requests.rs index 8dcbbd477..f6bd5f805 100644 --- a/generated/stripe_misc/src/identity_verification_session/requests.rs +++ b/generated/stripe_misc/src/identity_verification_session/requests.rs @@ -310,11 +310,12 @@ impl<'a> ListIdentityVerificationSession<'a> { ) -> stripe::Response> { client.get_query("/identity/verification_sessions", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/identity/verification_sessions", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/identity/verification_sessions", self) } } -impl<'a> stripe::PaginationParams for ListIdentityVerificationSession<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct CancelIdentityVerificationSession<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_misc/src/reporting_report_run/requests.rs b/generated/stripe_misc/src/reporting_report_run/requests.rs index 02f1220aa..eb53409cc 100644 --- a/generated/stripe_misc/src/reporting_report_run/requests.rs +++ b/generated/stripe_misc/src/reporting_report_run/requests.rs @@ -2131,8 +2131,9 @@ impl<'a> ListReportingReportRun<'a> { ) -> stripe::Response> { client.get_query("/reporting/report_runs", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/reporting/report_runs", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/reporting/report_runs", self) } } -impl<'a> stripe::PaginationParams for ListReportingReportRun<'a> {} diff --git a/generated/stripe_misc/src/reporting_report_type/requests.rs b/generated/stripe_misc/src/reporting_report_type/requests.rs index 8eaa1d97d..cb5249365 100644 --- a/generated/stripe_misc/src/reporting_report_type/requests.rs +++ b/generated/stripe_misc/src/reporting_report_type/requests.rs @@ -40,8 +40,9 @@ impl<'a> ListReportingReportType<'a> { ) -> stripe::Response> { client.get_query("/reporting/report_types", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/reporting/report_types", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/reporting/report_types", self) } } -impl<'a> stripe::PaginationParams for ListReportingReportType<'a> {} diff --git a/generated/stripe_misc/src/scheduled_query_run/requests.rs b/generated/stripe_misc/src/scheduled_query_run/requests.rs index 5169dd025..d8ea45883 100644 --- a/generated/stripe_misc/src/scheduled_query_run/requests.rs +++ b/generated/stripe_misc/src/scheduled_query_run/requests.rs @@ -34,11 +34,12 @@ impl<'a> ListScheduledQueryRun<'a> { ) -> stripe::Response> { client.get_query("/sigma/scheduled_query_runs", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/sigma/scheduled_query_runs", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/sigma/scheduled_query_runs", self) } } -impl<'a> stripe::PaginationParams for ListScheduledQueryRun<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveScheduledQueryRun<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_misc/src/tax_calculation/requests.rs b/generated/stripe_misc/src/tax_calculation/requests.rs index 8b52114eb..1b41a24dc 100644 --- a/generated/stripe_misc/src/tax_calculation/requests.rs +++ b/generated/stripe_misc/src/tax_calculation/requests.rs @@ -697,11 +697,10 @@ impl<'a> ListLineItemsTaxCalculation<'a> { pub fn paginate( self, calculation: &stripe_misc::tax_calculation::TaxCalculationId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params( + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( &format!("/tax/calculations/{calculation}/line_items"), self, ) } } -impl<'a> stripe::PaginationParams for ListLineItemsTaxCalculation<'a> {} diff --git a/generated/stripe_misc/src/tax_registration/requests.rs b/generated/stripe_misc/src/tax_registration/requests.rs index 17e2c0efc..3fbd6d411 100644 --- a/generated/stripe_misc/src/tax_registration/requests.rs +++ b/generated/stripe_misc/src/tax_registration/requests.rs @@ -94,11 +94,12 @@ impl<'a> ListTaxRegistration<'a> { ) -> stripe::Response> { client.get_query("/tax/registrations", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/tax/registrations", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/tax/registrations", self) } } -impl<'a> stripe::PaginationParams for ListTaxRegistration<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreateTaxRegistration<'a> { /// Time at which the Tax Registration becomes active. diff --git a/generated/stripe_misc/src/tax_transaction/requests.rs b/generated/stripe_misc/src/tax_transaction/requests.rs index f7c549092..cafa648f7 100644 --- a/generated/stripe_misc/src/tax_transaction/requests.rs +++ b/generated/stripe_misc/src/tax_transaction/requests.rs @@ -249,11 +249,10 @@ impl<'a> ListLineItemsTaxTransaction<'a> { pub fn paginate( self, transaction: &stripe_misc::tax_transaction::TaxTransactionId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params( + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( &format!("/tax/transactions/{transaction}/line_items"), self, ) } } -impl<'a> stripe::PaginationParams for ListLineItemsTaxTransaction<'a> {} diff --git a/generated/stripe_misc/src/webhook_endpoint/requests.rs b/generated/stripe_misc/src/webhook_endpoint/requests.rs index 7a72ad2cb..a828fc40d 100644 --- a/generated/stripe_misc/src/webhook_endpoint/requests.rs +++ b/generated/stripe_misc/src/webhook_endpoint/requests.rs @@ -34,11 +34,12 @@ impl<'a> ListWebhookEndpoint<'a> { ) -> stripe::Response> { client.get_query("/webhook_endpoints", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/webhook_endpoints", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/webhook_endpoints", self) } } -impl<'a> stripe::PaginationParams for ListWebhookEndpoint<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveWebhookEndpoint<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_payment/src/payment_link/requests.rs b/generated/stripe_payment/src/payment_link/requests.rs index 6f209ed89..4ef2fd991 100644 --- a/generated/stripe_payment/src/payment_link/requests.rs +++ b/generated/stripe_payment/src/payment_link/requests.rs @@ -37,11 +37,10 @@ impl<'a> ListPaymentLink<'a> { ) -> stripe::Response> { client.get_query("/payment_links", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/payment_links", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/payment_links", self) } } -impl<'a> stripe::PaginationParams for ListPaymentLink<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrievePaymentLink<'a> { /// Specifies which fields in the response should be expanded. @@ -105,14 +104,13 @@ impl<'a> ListLineItemsPaymentLink<'a> { pub fn paginate( self, payment_link: &stripe_shared::payment_link::PaymentLinkId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params( + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( &format!("/payment_links/{payment_link}/line_items"), self, ) } } -impl<'a> stripe::PaginationParams for ListLineItemsPaymentLink<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreatePaymentLink<'a> { /// Behavior after the purchase is complete. diff --git a/generated/stripe_payment/src/payment_method/requests.rs b/generated/stripe_payment/src/payment_method/requests.rs index ad3f93b1c..761c63fba 100644 --- a/generated/stripe_payment/src/payment_method/requests.rs +++ b/generated/stripe_payment/src/payment_method/requests.rs @@ -1668,11 +1668,12 @@ impl<'a> ListPaymentMethod<'a> { ) -> stripe::Response> { client.get_query("/payment_methods", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/payment_methods", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/payment_methods", self) } } -impl<'a> stripe::PaginationParams for ListPaymentMethod<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct AttachPaymentMethod<'a> { /// The ID of the customer to which to attach the PaymentMethod. diff --git a/generated/stripe_payment/src/payment_method_configuration/requests.rs b/generated/stripe_payment/src/payment_method_configuration/requests.rs index 58c85da50..8c78714ce 100644 --- a/generated/stripe_payment/src/payment_method_configuration/requests.rs +++ b/generated/stripe_payment/src/payment_method_configuration/requests.rs @@ -20,11 +20,12 @@ impl<'a> ListPaymentMethodConfiguration<'a> { ) -> stripe::Response> { client.get_query("/payment_method_configurations", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/payment_method_configurations", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/payment_method_configurations", self) } } -impl<'a> stripe::PaginationParams for ListPaymentMethodConfiguration<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrievePaymentMethodConfiguration<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_payment/src/payment_method_domain/requests.rs b/generated/stripe_payment/src/payment_method_domain/requests.rs index d481b358f..1935af0fc 100644 --- a/generated/stripe_payment/src/payment_method_domain/requests.rs +++ b/generated/stripe_payment/src/payment_method_domain/requests.rs @@ -63,11 +63,12 @@ impl<'a> ListPaymentMethodDomain<'a> { ) -> stripe::Response> { client.get_query("/payment_method_domains", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/payment_method_domains", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/payment_method_domains", self) } } -impl<'a> stripe::PaginationParams for ListPaymentMethodDomain<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreatePaymentMethodDomain<'a> { /// The domain name that this payment method domain object represents. diff --git a/generated/stripe_payment/src/source/requests.rs b/generated/stripe_payment/src/source/requests.rs index 26021dd6c..0d9fc6fda 100644 --- a/generated/stripe_payment/src/source/requests.rs +++ b/generated/stripe_payment/src/source/requests.rs @@ -1536,8 +1536,10 @@ impl<'a> SourceTransactionsSource<'a> { pub fn paginate( self, source: &stripe_shared::source::SourceId, - ) -> stripe::ListPaginator { - stripe::ListPaginator::from_params(&format!("/sources/{source}/source_transactions"), self) + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/sources/{source}/source_transactions"), + self, + ) } } -impl<'a> stripe::PaginationParams for SourceTransactionsSource<'a> {} diff --git a/generated/stripe_product/src/coupon/requests.rs b/generated/stripe_product/src/coupon/requests.rs index 0d740c7b5..032ec0ec0 100644 --- a/generated/stripe_product/src/coupon/requests.rs +++ b/generated/stripe_product/src/coupon/requests.rs @@ -39,11 +39,10 @@ impl<'a> ListCoupon<'a> { ) -> stripe::Response> { client.get_query("/coupons", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/coupons", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/coupons", self) } } -impl<'a> stripe::PaginationParams for ListCoupon<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct CreateCoupon<'a> { /// A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed). diff --git a/generated/stripe_product/src/price/requests.rs b/generated/stripe_product/src/price/requests.rs index a847c0166..0d9706fd1 100644 --- a/generated/stripe_product/src/price/requests.rs +++ b/generated/stripe_product/src/price/requests.rs @@ -37,6 +37,9 @@ impl<'a> SearchPrice<'a> { ) -> stripe::Response> { client.get_query("/prices/search", self) } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/prices/search", self) + } } #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct ListPrice<'a> { @@ -282,11 +285,10 @@ impl<'a> ListPrice<'a> { ) -> stripe::Response> { client.get_query("/prices", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/prices", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/prices", self) } } -impl<'a> stripe::PaginationParams for ListPrice<'a> {} #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreatePrice<'a> { /// Whether the price can be used for new purchases. diff --git a/generated/stripe_product/src/product/requests.rs b/generated/stripe_product/src/product/requests.rs index 22e9e8f19..c2e039b30 100644 --- a/generated/stripe_product/src/product/requests.rs +++ b/generated/stripe_product/src/product/requests.rs @@ -37,6 +37,11 @@ impl<'a> SearchProduct<'a> { ) -> stripe::Response> { client.get_query("/products/search", self) } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/products/search", self) + } } #[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreateProduct<'a> { @@ -839,11 +844,10 @@ impl<'a> ListProduct<'a> { ) -> stripe::Response> { client.get_query("/products", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/products", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/products", self) } } -impl<'a> stripe::PaginationParams for ListProduct<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct DeleteProduct {} impl DeleteProduct { diff --git a/generated/stripe_product/src/promotion_code/requests.rs b/generated/stripe_product/src/promotion_code/requests.rs index a067eb92a..ef3751217 100644 --- a/generated/stripe_product/src/promotion_code/requests.rs +++ b/generated/stripe_product/src/promotion_code/requests.rs @@ -256,8 +256,9 @@ impl<'a> ListPromotionCode<'a> { ) -> stripe::Response> { client.get_query("/promotion_codes", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/promotion_codes", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/promotion_codes", self) } } -impl<'a> stripe::PaginationParams for ListPromotionCode<'a> {} diff --git a/generated/stripe_product/src/shipping_rate/requests.rs b/generated/stripe_product/src/shipping_rate/requests.rs index 8b5fd35af..0538486ac 100644 --- a/generated/stripe_product/src/shipping_rate/requests.rs +++ b/generated/stripe_product/src/shipping_rate/requests.rs @@ -45,11 +45,12 @@ impl<'a> ListShippingRate<'a> { ) -> stripe::Response> { client.get_query("/shipping_rates", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/shipping_rates", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/shipping_rates", self) } } -impl<'a> stripe::PaginationParams for ListShippingRate<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveShippingRate<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_product/src/tax_code/requests.rs b/generated/stripe_product/src/tax_code/requests.rs index 06d433c19..80e4ce5e7 100644 --- a/generated/stripe_product/src/tax_code/requests.rs +++ b/generated/stripe_product/src/tax_code/requests.rs @@ -34,11 +34,10 @@ impl<'a> ListTaxCode<'a> { ) -> stripe::Response> { client.get_query("/tax_codes", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/tax_codes", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/tax_codes", self) } } -impl<'a> stripe::PaginationParams for ListTaxCode<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveTaxCode<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_product/src/tax_rate/requests.rs b/generated/stripe_product/src/tax_rate/requests.rs index d7cd53d48..33123a39c 100644 --- a/generated/stripe_product/src/tax_rate/requests.rs +++ b/generated/stripe_product/src/tax_rate/requests.rs @@ -45,11 +45,10 @@ impl<'a> ListTaxRate<'a> { ) -> stripe::Response> { client.get_query("/tax_rates", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/tax_rates", self) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/tax_rates", self) } } -impl<'a> stripe::PaginationParams for ListTaxRate<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveTaxRate<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_terminal/src/terminal_configuration/requests.rs b/generated/stripe_terminal/src/terminal_configuration/requests.rs index c6822ea1f..00180707c 100644 --- a/generated/stripe_terminal/src/terminal_configuration/requests.rs +++ b/generated/stripe_terminal/src/terminal_configuration/requests.rs @@ -409,11 +409,12 @@ impl<'a> ListTerminalConfiguration<'a> { ) -> stripe::Response> { client.get_query("/terminal/configurations", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/terminal/configurations", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/terminal/configurations", self) } } -impl<'a> stripe::PaginationParams for ListTerminalConfiguration<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveTerminalConfiguration<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_terminal/src/terminal_location/requests.rs b/generated/stripe_terminal/src/terminal_location/requests.rs index 303ff83b5..1eff250d9 100644 --- a/generated/stripe_terminal/src/terminal_location/requests.rs +++ b/generated/stripe_terminal/src/terminal_location/requests.rs @@ -194,11 +194,12 @@ impl<'a> ListTerminalLocation<'a> { ) -> stripe::Response> { client.get_query("/terminal/locations", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/terminal/locations", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/terminal/locations", self) } } -impl<'a> stripe::PaginationParams for ListTerminalLocation<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct DeleteTerminalLocation {} impl DeleteTerminalLocation { diff --git a/generated/stripe_terminal/src/terminal_reader/requests.rs b/generated/stripe_terminal/src/terminal_reader/requests.rs index 283b3f30f..95d21af3d 100644 --- a/generated/stripe_terminal/src/terminal_reader/requests.rs +++ b/generated/stripe_terminal/src/terminal_reader/requests.rs @@ -263,11 +263,12 @@ impl<'a> ListTerminalReader<'a> { ) -> stripe::Response> { client.get_query("/terminal/readers", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/terminal/readers", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/terminal/readers", self) } } -impl<'a> stripe::PaginationParams for ListTerminalReader<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct DeleteTerminalReader {} impl DeleteTerminalReader { diff --git a/generated/stripe_treasury/src/treasury_credit_reversal/requests.rs b/generated/stripe_treasury/src/treasury_credit_reversal/requests.rs index 6a2b21b27..5f97c2767 100644 --- a/generated/stripe_treasury/src/treasury_credit_reversal/requests.rs +++ b/generated/stripe_treasury/src/treasury_credit_reversal/requests.rs @@ -104,11 +104,12 @@ impl<'a> ListTreasuryCreditReversal<'a> { ) -> stripe::Response> { client.get_query("/treasury/credit_reversals", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/treasury/credit_reversals", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/credit_reversals", self) } } -impl<'a> stripe::PaginationParams for ListTreasuryCreditReversal<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveTreasuryCreditReversal<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_treasury/src/treasury_debit_reversal/requests.rs b/generated/stripe_treasury/src/treasury_debit_reversal/requests.rs index c0b8a2f22..cc1f80fd0 100644 --- a/generated/stripe_treasury/src/treasury_debit_reversal/requests.rs +++ b/generated/stripe_treasury/src/treasury_debit_reversal/requests.rs @@ -209,8 +209,9 @@ impl<'a> ListTreasuryDebitReversal<'a> { ) -> stripe::Response> { client.get_query("/treasury/debit_reversals", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/treasury/debit_reversals", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/debit_reversals", self) } } -impl<'a> stripe::PaginationParams for ListTreasuryDebitReversal<'a> {} diff --git a/generated/stripe_treasury/src/treasury_financial_account/requests.rs b/generated/stripe_treasury/src/treasury_financial_account/requests.rs index e761cf4b2..b223a8173 100644 --- a/generated/stripe_treasury/src/treasury_financial_account/requests.rs +++ b/generated/stripe_treasury/src/treasury_financial_account/requests.rs @@ -934,11 +934,12 @@ impl<'a> ListTreasuryFinancialAccount<'a> { ) -> stripe::Response> { client.get_query("/treasury/financial_accounts", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/treasury/financial_accounts", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/financial_accounts", self) } } -impl<'a> stripe::PaginationParams for ListTreasuryFinancialAccount<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveTreasuryFinancialAccount<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_treasury/src/treasury_inbound_transfer/requests.rs b/generated/stripe_treasury/src/treasury_inbound_transfer/requests.rs index 8bdd3392a..d8d1d5ade 100644 --- a/generated/stripe_treasury/src/treasury_inbound_transfer/requests.rs +++ b/generated/stripe_treasury/src/treasury_inbound_transfer/requests.rs @@ -210,11 +210,12 @@ impl<'a> ListTreasuryInboundTransfer<'a> { ) -> stripe::Response> { client.get_query("/treasury/inbound_transfers", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/treasury/inbound_transfers", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/inbound_transfers", self) } } -impl<'a> stripe::PaginationParams for ListTreasuryInboundTransfer<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct SucceedTreasuryInboundTransfer<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_treasury/src/treasury_outbound_payment/requests.rs b/generated/stripe_treasury/src/treasury_outbound_payment/requests.rs index d995e8ef9..64c7e1b5a 100644 --- a/generated/stripe_treasury/src/treasury_outbound_payment/requests.rs +++ b/generated/stripe_treasury/src/treasury_outbound_payment/requests.rs @@ -621,11 +621,12 @@ impl<'a> ListTreasuryOutboundPayment<'a> { ) -> stripe::Response> { client.get_query("/treasury/outbound_payments", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/treasury/outbound_payments", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/outbound_payments", self) } } -impl<'a> stripe::PaginationParams for ListTreasuryOutboundPayment<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct CancelTreasuryOutboundPayment<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_treasury/src/treasury_outbound_transfer/requests.rs b/generated/stripe_treasury/src/treasury_outbound_transfer/requests.rs index 98c5a306b..cba47af56 100644 --- a/generated/stripe_treasury/src/treasury_outbound_transfer/requests.rs +++ b/generated/stripe_treasury/src/treasury_outbound_transfer/requests.rs @@ -277,11 +277,12 @@ impl<'a> ListTreasuryOutboundTransfer<'a> { ) -> stripe::Response> { client.get_query("/treasury/outbound_transfers", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/treasury/outbound_transfers", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/outbound_transfers", self) } } -impl<'a> stripe::PaginationParams for ListTreasuryOutboundTransfer<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct CancelTreasuryOutboundTransfer<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_treasury/src/treasury_received_credit/requests.rs b/generated/stripe_treasury/src/treasury_received_credit/requests.rs index b9f194717..c554a7874 100644 --- a/generated/stripe_treasury/src/treasury_received_credit/requests.rs +++ b/generated/stripe_treasury/src/treasury_received_credit/requests.rs @@ -169,11 +169,12 @@ impl<'a> ListTreasuryReceivedCredit<'a> { ) -> stripe::Response> { client.get_query("/treasury/received_credits", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/treasury/received_credits", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/received_credits", self) } } -impl<'a> stripe::PaginationParams for ListTreasuryReceivedCredit<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveTreasuryReceivedCredit<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_treasury/src/treasury_received_debit/requests.rs b/generated/stripe_treasury/src/treasury_received_debit/requests.rs index 0142b88dd..53fa18bf7 100644 --- a/generated/stripe_treasury/src/treasury_received_debit/requests.rs +++ b/generated/stripe_treasury/src/treasury_received_debit/requests.rs @@ -97,11 +97,12 @@ impl<'a> ListTreasuryReceivedDebit<'a> { ) -> stripe::Response> { client.get_query("/treasury/received_debits", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/treasury/received_debits", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/received_debits", self) } } -impl<'a> stripe::PaginationParams for ListTreasuryReceivedDebit<'a> {} #[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct RetrieveTreasuryReceivedDebit<'a> { /// Specifies which fields in the response should be expanded. diff --git a/generated/stripe_treasury/src/treasury_transaction/requests.rs b/generated/stripe_treasury/src/treasury_transaction/requests.rs index c7ecb6cfd..a996afc1b 100644 --- a/generated/stripe_treasury/src/treasury_transaction/requests.rs +++ b/generated/stripe_treasury/src/treasury_transaction/requests.rs @@ -203,8 +203,9 @@ impl<'a> ListTreasuryTransaction<'a> { ) -> stripe::Response> { client.get_query("/treasury/transactions", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/treasury/transactions", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/transactions", self) } } -impl<'a> stripe::PaginationParams for ListTreasuryTransaction<'a> {} diff --git a/generated/stripe_treasury/src/treasury_transaction_entry/requests.rs b/generated/stripe_treasury/src/treasury_transaction_entry/requests.rs index 00141aad7..8d213bde7 100644 --- a/generated/stripe_treasury/src/treasury_transaction_entry/requests.rs +++ b/generated/stripe_treasury/src/treasury_transaction_entry/requests.rs @@ -132,8 +132,9 @@ impl<'a> ListTreasuryTransactionEntry<'a> { ) -> stripe::Response> { client.get_query("/treasury/transaction_entries", self) } - pub fn paginate(self) -> stripe::ListPaginator { - stripe::ListPaginator::from_params("/treasury/transaction_entries", self) + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/transaction_entries", self) } } -impl<'a> stripe::PaginationParams for ListTreasuryTransactionEntry<'a> {} diff --git a/openapi/src/templates/requests.rs b/openapi/src/templates/requests.rs index 2322ba721..f9fc0c6c6 100644 --- a/openapi/src/templates/requests.rs +++ b/openapi/src/templates/requests.rs @@ -39,29 +39,21 @@ impl RequestSpec { "".into() }; let impl_for = components.construct_printable_type(&self.params); - let maybe_inner_list_typ = as_list_inner_typ(&self.returned); - if let Some(inner_list_typ) = maybe_inner_list_typ { + if let Some(pagination_kind) = as_pagination_kind(&self.returned) { self.gen_paginate( - components.construct_printable_type(inner_list_typ), + components.construct_printable_type(&self.returned), + pagination_kind, &mut req_out, components, - ); + ) } - let mut out = formatdoc!( + formatdoc!( r#" impl{lifetime_str} {impl_for}{lifetime_str} {{ {req_out} }} "# - ); - - if maybe_inner_list_typ.is_some() { - let _ = writeln!( - out, - r"impl{lifetime_str} stripe::PaginationParams for {impl_for}{lifetime_str} {{}}" - ); - } - out + ) } fn write_req_body(&self, out: &mut String, components: &Components) { @@ -96,28 +88,43 @@ impl RequestSpec { ); } - pub fn gen_paginate( + fn gen_paginate( &self, - inner_pagination_typ: PrintableType, + pagination_typ: PrintableType, + kind: PaginationKind, out: &mut String, components: &Components, ) { let path = self.gen_path_arg(); let path_params = self.gen_method_path_params(components); + + let paginate_method_name = match kind { + PaginationKind::List => "from_list_params", + PaginationKind::Search => "from_search_params", + }; let _ = writedoc!( out, r#" - pub fn paginate(self, {path_params}) -> stripe::ListPaginator<{inner_pagination_typ}> {{ - stripe::ListPaginator::from_params({path}, self) + pub fn paginate(self, {path_params}) -> stripe::ListPaginator<{pagination_typ}> {{ + stripe::ListPaginator::{paginate_method_name}({path}, self) }} "# ); } } -fn as_list_inner_typ(typ: &RustType) -> Option<&RustType> { +#[derive(Copy, Clone)] +enum PaginationKind { + /// List + List, + /// Search + Search, +} + +fn as_pagination_kind(typ: &RustType) -> Option { match typ { - RustType::Container(Container::List(typ)) => Some(typ), + RustType::Container(Container::List(_)) => Some(PaginationKind::List), + RustType::Container(Container::SearchList(_)) => Some(PaginationKind::Search), _ => None, } } diff --git a/stripe_types/src/pagination.rs b/stripe_types/src/pagination.rs index 3ad96ae7f..8931851ac 100644 --- a/stripe_types/src/pagination.rs +++ b/stripe_types/src/pagination.rs @@ -1,4 +1,8 @@ +use std::fmt::Debug; + +use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; +use serde_json::Value; /// Implemented by types which represent stripe objects. pub trait Object { @@ -34,6 +38,75 @@ impl AsCursorOpt for Option { } } +/// A trait allowing `List` and `SearchList` to be treated the same. Not part of the +/// public API. +/// +/// NB: this trait is designed specifically for `List` and `SearchList` and may not be sensible +/// in other cases. One gotcha is that `into_parts` and `from_parts` do not necessarily +/// round-trip, e.g. `SearchList` will lose the `next_page` field since that +/// is not part of the shared list impl. We account for this by ensuring to call `update_params` +/// before breaking the `SearchList` into pieces. +#[doc(hidden)] +pub trait PaginableList: DeserializeOwned { + /// Underlying single element type, e.g. `Account` + type Data; + + /// Break into the shared parts list pagination requires + fn into_parts(self) -> ListParts; + + /// Reconstruct from the shared parts list pagination requires + fn from_parts(parts: ListParts) -> Self; + + /// Update the current parameter set, with `self` as the most + /// recently fetched page. + /// + /// NB: this should also set `has_more` to `false` explicitly if we don't have a new cursor. + /// (This seems redundant with `has_more` but is used to provide extra protection + /// against any possibility where `has_more` is `true`, but the cursor is back to `None`, + /// potentially leading to an infinite pagination loop). + fn update_params(&mut self, params: &mut Value); +} + +/// Specific list parts relied on by the client for pagination. +#[doc(hidden)] +#[derive(Debug)] +pub struct ListParts { + pub total_count: Option, + pub url: String, + pub data: Vec, + pub has_more: bool, +} + +impl PaginableList for List { + type Data = T; + + fn into_parts(self) -> ListParts { + ListParts { + total_count: self.total_count, + url: self.url, + data: self.data, + has_more: self.has_more, + } + } + + fn from_parts(parts: ListParts) -> Self { + Self { + data: parts.data, + has_more: parts.has_more, + total_count: parts.total_count, + url: parts.url, + } + } + + fn update_params(&mut self, params: &mut Value) { + if let Some(new_cursor) = self.data.last().and_then(|l| l.id().as_cursor_opt()) { + params["starting_after"] = Value::String(new_cursor.into()); + } else { + self.has_more = false; + } + } +} + /// A single page of a cursor-paginated list of an object. /// /// For more details, see @@ -71,7 +144,7 @@ pub struct SearchList { pub has_more: bool, pub data: Vec, pub next_page: Option, - pub total_count: Option, + pub total_count: Option, } impl Clone for SearchList { @@ -85,3 +158,36 @@ impl Clone for SearchList { } } } + +impl PaginableList for SearchList { + type Data = T; + + /// NB: here we lose `next_page`, so we should be sure to `update_params` + /// before calling this. + fn into_parts(self) -> ListParts { + ListParts { + total_count: self.total_count, + url: self.url, + data: self.data, + has_more: self.has_more, + } + } + + fn from_parts(parts: ListParts) -> Self { + Self { + url: parts.url, + has_more: parts.has_more, + data: parts.data, + next_page: None, + total_count: parts.total_count, + } + } + + fn update_params(&mut self, params: &mut Value) { + if let Some(next_page) = self.next_page.take() { + params["page"] = Value::String(next_page); + } else { + self.has_more = false; + } + } +} diff --git a/tests/Cargo.toml b/tests/Cargo.toml index a352b4cc9..9ad327741 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -5,9 +5,12 @@ edition = "2021" publish = false [dev-dependencies] +serde.workspace = true serde_json = "1" +serde_qs = "0.12.0" chrono = "0.4.26" httpmock = "0.6.7" +wiremock = "0.5.22" futures-util = { version = "0.3.21" } tokio = { version = "1.24.1", features = ["rt", "macros"] } stripe_types = {path = "../stripe_types"} diff --git a/tests/tests/it/async_tests/pagination.rs b/tests/tests/it/async_tests/pagination.rs index 7845091a0..baf28e0e6 100644 --- a/tests/tests/it/async_tests/pagination.rs +++ b/tests/tests/it/async_tests/pagination.rs @@ -1,79 +1,176 @@ +use futures_util::StreamExt; +use futures_util::TryStreamExt; +use stripe::PaginationExt; use stripe::{AccountId, Client}; use stripe_connect::account::ListAccount; -use stripe_core::customer::ListCustomer; +use stripe_core::customer::{CustomerId, ListCustomer, SearchCustomer}; +use stripe_core::Customer; use crate::mock::get_client; +use crate::pagination_utils::{cons_cus_id, parse_cus_id, PaginationMock, PaginationMockKind}; + +const PAGINATION_KINDS: [PaginationMockKind; 2] = + [PaginationMockKind::List, PaginationMockKind::Search]; #[tokio::test] async fn is_account_listable() { - use futures_util::TryStreamExt; let client = get_client(); let expected_id: AccountId = "acct_1O8RSFF2YyVaukgl".parse().unwrap(); + // Paginating from nothing let result = ListAccount::new().paginate().stream(&client).try_collect::>().await.unwrap(); assert_eq!(result.len(), 1); assert_eq!(result.first().unwrap().id, expected_id); + + // Should be same result making a single request, then paginating that returned list since there's no + // additional data + let result = ListAccount::new().send(&client).await.unwrap(); + assert_eq!(result.data.len(), 1); + assert_eq!(result.data.first().unwrap().id, expected_id); + + let result = result.into_paginator().stream(&client).try_collect::>().await.unwrap(); + assert_eq!(result.len(), 1); + assert_eq!(result.first().unwrap().id, expected_id); +} + +#[tokio::test] +async fn is_customer_searchable() { + let client = get_client(); + let expected_id: CustomerId = "cus_OwK6KtfP4mMA7U".parse().unwrap(); + + // Paginating from nothing + let result = SearchCustomer::new("unused_query") + .paginate() + .stream(&client) + .try_collect::>() + .await + .unwrap(); + assert_eq!(result.len(), 1); + assert_eq!(result.first().unwrap().id, expected_id); + + // Should be same result making a single request, then paginating that returned list since there's no + // additional data + let result = SearchCustomer::new("unused_query").send(&client).await.unwrap(); + assert_eq!(result.data.len(), 1); + assert_eq!(result.data.first().unwrap().id, expected_id); + + let result = result.into_paginator().stream(&client).try_collect::>().await.unwrap(); + assert_eq!(result.len(), 1); + assert_eq!(result.first().unwrap().id, expected_id); +} + +/// `PaginationMock` docs best explain how the mock pagination works. This function ensures +/// that we both fetched the correct data and made the correct series of API calls when paginating +/// all data from `initial_cursor` onward. +/// +// FIXME: add `track_caller` once that's supported for async on stable so easier to see any +// failing cases +async fn check_get_all( + kind: PaginationMockKind, + customer_count: usize, + limit: Option, + initial_cursor: Option, + expected_cursors: Vec>, +) { + let mocker = PaginationMock::new(customer_count, kind).await; + let client = Client::from_url(&*mocker.url(), "fake_key"); + let initial_cursor_str = initial_cursor.map(cons_cus_id); + let items: Vec = match kind { + PaginationMockKind::List => { + let params = ListCustomer { + limit, + starting_after: initial_cursor_str.as_deref(), + ..Default::default() + }; + params.paginate().stream(&client).try_collect().await.unwrap() + } + PaginationMockKind::Search => { + let params = SearchCustomer { + limit, + page: initial_cursor_str.as_deref(), + query: "unused", + expand: None, + }; + params.paginate().stream(&client).try_collect().await.unwrap() + } + }; + + mocker.assert_cursors_received(&expected_cursors).await; + let all_ids_received = items.into_iter().map(|c| c.id.to_string()).collect::>(); + let expected_ids = if let Some(start_cursor) = initial_cursor { + mocker.all_ids_after(start_cursor) + } else { + mocker.all_ids() + }; + assert_eq!(all_ids_received, expected_ids); +} + +/// `PaginationMock` docs best explain how the mock pagination works. This function ensures +/// that we both fetched the correct data and made the correct series of API calls when paginating +/// any amount of data from `initial_cursor` onward. +/// +// FIXME: add `track_caller` once that's supported for async on stable so easier to see any +// failing cases +async fn check_partial( + kind: PaginationMockKind, + count_to_get: usize, + initial_cursor: Option, + expected_cursors: Vec>, + expected_ids_received: Vec, +) { + let mocker = PaginationMock::new(10, kind).await; + let client = Client::from_url(&*mocker.url(), "fake_key"); + let initial_cursor_str = initial_cursor.map(cons_cus_id); + let items: Vec = match kind { + PaginationMockKind::List => { + let params = ListCustomer { + limit: Some(5), + starting_after: initial_cursor_str.as_deref(), + ..Default::default() + }; + params.paginate().stream(&client).take(count_to_get).try_collect().await.unwrap() + } + PaginationMockKind::Search => { + let params = SearchCustomer { + limit: Some(5), + page: initial_cursor_str.as_deref(), + query: "unused", + expand: None, + }; + params.paginate().stream(&client).take(count_to_get).try_collect().await.unwrap() + } + }; + + mocker.assert_cursors_received(&expected_cursors).await; + let all_ids_received = + items.into_iter().map(|c| parse_cus_id(c.id.as_str())).collect::>(); + assert_eq!(all_ids_received, expected_ids_received); +} + +#[tokio::test] +async fn pagination_get_all() { + for kind in PAGINATION_KINDS { + check_get_all(kind, 0, None, None, vec![None]).await; + check_get_all(kind, 2, None, None, vec![None]).await; + check_get_all(kind, 2, Some(1), None, vec![None, Some(1)]).await; + check_get_all(kind, 10, Some(3), None, vec![None, Some(3), Some(6), Some(9)]).await; + } +} + +#[tokio::test] +async fn pagination_starting_not_at_beginning() { + for kind in PAGINATION_KINDS { + check_get_all(kind, 2, None, Some(1), vec![Some(1)]).await; + check_get_all(kind, 10, Some(3), Some(4), vec![Some(4), Some(7), Some(10)]).await; + } } #[tokio::test] -async fn stream() { - use futures_util::StreamExt; - use httpmock::Method::GET; - use httpmock::MockServer; - - // Start a lightweight mock server. - let server = MockServer::start_async().await; - - let client = Client::from_url(&*server.url("/"), "fake_key"); - - let next_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers").query_param("starting_after", "cus_1"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_2", - "object": "customer", - "balance": 0, - "created": 1649316731, - "currency": "gbp", - "delinquent": false, - "email": null, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": false, "url": "/v1/customers"}"#, - ); - }); - - let first_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_1", - "object": "customer", - "balance": 0, - "created": 1649316731, - "currency": "gbp", - "delinquent": false, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": true, "url": "/v1/customers"}"#, - ); - }); - - let paginator = ListCustomer::new().paginate(); - - let stream = paginator.stream(&client).collect::>().await; - - assert_eq!(stream.len(), 2); - - first_item.assert_hits_async(1).await; - next_item.assert_hits_async(1).await; +async fn partial_pagination() { + for kind in PAGINATION_KINDS { + check_partial(kind, 2, None, vec![None], vec![1, 2]).await; + check_partial(kind, 2, Some(2), vec![Some(2)], vec![3, 4]).await; + check_partial(kind, 7, Some(1), vec![Some(1), Some(6)], vec![2, 3, 4, 5, 6, 7, 8]).await; + } } diff --git a/tests/tests/it/main.rs b/tests/tests/it/main.rs index 9e25544cd..8f6525cef 100644 --- a/tests/tests/it/main.rs +++ b/tests/tests/it/main.rs @@ -8,3 +8,4 @@ mod price; mod async_tests; #[cfg(feature = "blocking")] mod blocking; +mod pagination_utils; diff --git a/tests/tests/it/pagination_utils.rs b/tests/tests/it/pagination_utils.rs new file mode 100644 index 000000000..6dcb7a358 --- /dev/null +++ b/tests/tests/it/pagination_utils.rs @@ -0,0 +1,188 @@ +//! Utilities defined to help test different pagination scenarios more easily. +use std::cmp::min; + +use serde_json::{json, Value}; +use wiremock::matchers::{method, path}; +use wiremock::{Mock, MockServer, Request, ResponseTemplate}; + +/// Basic mock customer data +fn mock_customer_data(customer_id: &str) -> Value { + json!({ + "id": customer_id, + "object": "customer", + "balance": 0, + "created": 1649316731, + "currency": "gbp", + "delinquent": false, + "email": null, + "invoice_prefix": "4AF7482", + "invoice_settings": {}, + "livemode": false, + "metadata": {}, + "preferred_locales": [], + "tax_exempt": "none" + }) +} + +fn mock_customer_list(customer_ids: &[String], has_more: bool) -> Value { + let data = customer_ids.iter().map(|id| mock_customer_data(id)).collect::>(); + json!({ + "object": "list", + "data": data, + "has_more": has_more, + "url": "/v1/customers" + }) +} + +fn mock_customer_search_list( + customer_ids: &[String], + has_more: bool, + next_page: Option<&String>, +) -> Value { + let data = customer_ids.iter().map(|id| mock_customer_data(id)).collect::>(); + json!({ + "object": "search_result", + "data": data, + "has_more": has_more, + "url": "/v1/customers/search", + "next_page": next_page + }) +} + +fn extract_params(req: &Request) -> serde_json::Map { + if let Some(query) = req.url.query() { + serde_qs::from_str(query).expect("invalid list customer request") + } else { + Default::default() + } +} + +/// Extract an index from a customer id in the format expected by our mocks +pub fn parse_cus_id(cus_id: &str) -> usize { + cus_id.trim_start_matches("cus_").parse().expect("expected usize") +} + +/// Construct a customer id from an index in the format expected by our mocks +pub fn cons_cus_id(id: usize) -> String { + format!("cus_{id}") +} + +/// Are we testing `List` or `SearchList`? +#[derive(Copy, Clone, Debug)] +pub enum PaginationMockKind { + List, + Search, +} + +impl PaginationMockKind { + /// Expected pagination cursor for this kind of operation + fn cursor_name(self) -> &'static str { + match self { + Self::List => "starting_after", + Self::Search => "page", + } + } + + fn extract_cursor_value(self, value: &serde_json::Map) -> Option { + Some(value.get(self.cursor_name())?.as_str().unwrap().to_string()) + } + + fn api_url(self) -> &'static str { + match self { + Self::List => "/v1/customers", + Self::Search => "/v1/customers/search", + } + } +} + +/// A super-simple mock server for testing pagination for either list or search requests +/// +/// Given a customer_count of `n`, the server will pretend it has mocked customer data +/// with ids `cus_1, cus_2, ..., cus_n`. +/// +/// For either the `starting_after` or `page` cursor of `cus_n`, the server will respond +/// with `cus_n+1, cus_n+2, ...` until either the `limit` param is reached or the last item is returned. +/// +/// This naive pagination should still ensure cursors are set correctly, and we make the correct number +/// of requests and paginate items in the right order. +#[derive(Debug)] +pub struct PaginationMock { + server: MockServer, + customer_count: usize, + kind: PaginationMockKind, +} + +impl PaginationMock { + pub async fn new(customer_count: usize, kind: PaginationMockKind) -> Self { + let server = MockServer::start().await; + let mock = Mock::given(method("GET")).and(path(kind.api_url())).respond_with( + move |req: &Request| { + let params = extract_params(req); + let limit: usize = params + .get("limit") + .map(|s| s.as_str().unwrap().parse().expect("invalid limit")) + .unwrap_or(10); + let next_customer_id: usize = + if let Some(cursor) = kind.extract_cursor_value(¶ms) { + parse_cus_id(&cursor) + 1 + } else { + 1 + }; + + let last_customer_id = min(customer_count, next_customer_id + limit - 1); + let has_more = last_customer_id != customer_count; + let id_batch_to_return = + (next_customer_id..=last_customer_id).map(cons_cus_id).collect::>(); + + if has_more { + assert_eq!(id_batch_to_return.len(), limit); + } + let mock_ret = match kind { + PaginationMockKind::List => mock_customer_list(&id_batch_to_return, has_more), + PaginationMockKind::Search => mock_customer_search_list( + &id_batch_to_return, + has_more, + id_batch_to_return.last(), + ), + }; + ResponseTemplate::new(200).set_body_json(mock_ret) + }, + ); + server.register(mock).await; + Self { server, customer_count, kind } + } + + pub fn url(&self) -> String { + self.server.uri() + } + + /// All ids we should have collected if we paginated from scratch and got everything + pub fn all_ids(&self) -> Vec { + (1..=self.customer_count).map(cons_cus_id).collect() + } + + /// All ids we should have collected if we paginated everything starting from + /// `after` + pub fn all_ids_after(&self, after: usize) -> Vec { + (after + 1..=self.customer_count).map(cons_cus_id).collect() + } + + /// Check that we received the expected requests. For example, `expected` might be + /// [None, 1, 4, 7], signaling that our mock saw 4 requests, first one without + /// a cursor, then `cus_1`, `cus_4`, `cus_7`. + pub async fn assert_cursors_received(&self, expected: &[Option]) { + let requests = self.server.received_requests().await.expect("we are recording requests"); + for (req, expected) in requests.iter().zip(expected) { + let params = extract_params(req); + if let Some(cursor) = self.kind.extract_cursor_value(¶ms) { + assert_eq!(Some(parse_cus_id(&cursor)), *expected) + } else { + assert!( + expected.is_none(), + "Received no query param, expected {}", + expected.unwrap() + ); + } + } + } +}