stripe/resources/generated/
subscription.rs

1// ======================================
2// This file was automatically generated.
3// ======================================
4
5use crate::client::{Client, Response};
6use crate::ids::{CouponId, CustomerId, PlanId, PriceId, PromotionCodeId, SubscriptionId};
7use crate::params::{
8    Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp,
9};
10use crate::resources::{
11    Account, Application, CollectionMethod, ConnectAccountReference, Currency, Customer, Discount,
12    Invoice, InvoicePaymentMethodOptionsAcssDebit, InvoicePaymentMethodOptionsBancontact,
13    InvoicePaymentMethodOptionsCustomerBalance, InvoicePaymentMethodOptionsKonbini,
14    InvoicePaymentMethodOptionsUsBankAccount, PaymentMethod, PaymentSource, Scheduled, SetupIntent,
15    SubscriptionBillingThresholds, SubscriptionItem, SubscriptionItemBillingThresholds,
16    SubscriptionSchedule, SubscriptionTransferData, SubscriptionsTrialsResourceTrialSettings,
17    TaxRate, TestHelpersTestClock,
18};
19use serde::{Deserialize, Serialize};
20
21/// The resource representing a Stripe "Subscription".
22///
23/// For more details see <https://stripe.com/docs/api/subscriptions/object>
24#[derive(Clone, Debug, Default, Deserialize, Serialize)]
25pub struct Subscription {
26    /// Unique identifier for the object.
27    pub id: SubscriptionId,
28
29    /// ID of the Connect Application that created the subscription.
30    pub application: Option<Expandable<Application>>,
31
32    /// A non-negative decimal between 0 and 100, with at most two decimal places.
33    ///
34    /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.
35    pub application_fee_percent: Option<f64>,
36
37    pub automatic_tax: SubscriptionAutomaticTax,
38
39    /// The reference point that aligns future [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle) dates.
40    ///
41    /// It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals.
42    /// The timestamp is in UTC format.
43    pub billing_cycle_anchor: Timestamp,
44
45    /// The fixed values used to calculate the `billing_cycle_anchor`.
46    pub billing_cycle_anchor_config: Option<SubscriptionsResourceBillingCycleAnchorConfig>,
47
48    /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period.
49    pub billing_thresholds: Option<SubscriptionBillingThresholds>,
50
51    /// A date in the future at which the subscription will automatically get canceled.
52    pub cancel_at: Option<Timestamp>,
53
54    /// If the subscription has been canceled with the `at_period_end` flag set to `true`, `cancel_at_period_end` on the subscription will be true.
55    ///
56    /// You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.
57    pub cancel_at_period_end: bool,
58
59    /// If the subscription has been canceled, the date of that cancellation.
60    ///
61    /// If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
62    pub canceled_at: Option<Timestamp>,
63
64    /// Details about why this subscription was cancelled.
65    pub cancellation_details: Option<CancellationDetails>,
66
67    /// Either `charge_automatically`, or `send_invoice`.
68    ///
69    /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer.
70    /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
71    pub collection_method: Option<CollectionMethod>,
72
73    /// Time at which the object was created.
74    ///
75    /// Measured in seconds since the Unix epoch.
76    pub created: Timestamp,
77
78    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
79    ///
80    /// Must be a [supported currency](https://stripe.com/docs/currencies).
81    pub currency: Currency,
82
83    /// End of the current period that the subscription has been invoiced for.
84    ///
85    /// At the end of this period, a new invoice will be created.
86    pub current_period_end: Timestamp,
87
88    /// Start of the current period that the subscription has been invoiced for.
89    pub current_period_start: Timestamp,
90
91    /// ID of the customer who owns the subscription.
92    pub customer: Expandable<Customer>,
93
94    /// Number of days a customer has to pay invoices generated by this subscription.
95    ///
96    /// This value will be `null` for subscriptions where `collection_method=charge_automatically`.
97    pub days_until_due: Option<u32>,
98
99    /// ID of the default payment method for the subscription.
100    ///
101    /// It must belong to the customer associated with the subscription.
102    /// This takes precedence over `default_source`.
103    /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
104    pub default_payment_method: Option<Expandable<PaymentMethod>>,
105
106    /// ID of the default payment source for the subscription.
107    ///
108    /// It must belong to the customer associated with the subscription and be in a chargeable state.
109    /// If `default_payment_method` is also set, `default_payment_method` will take precedence.
110    /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
111    pub default_source: Option<Expandable<PaymentSource>>,
112
113    /// The tax rates that will apply to any subscription item that does not have `tax_rates` set.
114    ///
115    /// Invoices created will have their `default_tax_rates` populated from the subscription.
116    #[serde(skip_serializing_if = "Option::is_none")]
117    pub default_tax_rates: Option<Vec<TaxRate>>,
118
119    /// The subscription's description, meant to be displayable to the customer.
120    ///
121    /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
122    pub description: Option<String>,
123
124    /// Describes the current discount applied to this subscription, if there is one.
125    ///
126    /// When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis.
127    pub discount: Option<Discount>,
128
129    /// If the subscription has ended, the date the subscription ended.
130    pub ended_at: Option<Timestamp>,
131
132    /// List of subscription items, each with an attached price.
133    pub items: List<SubscriptionItem>,
134
135    /// The most recent invoice this subscription has generated.
136    pub latest_invoice: Option<Expandable<Invoice>>,
137
138    /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
139    pub livemode: bool,
140
141    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
142    ///
143    /// This can be useful for storing additional information about the object in a structured format.
144    pub metadata: Metadata,
145
146    /// Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`.
147    pub next_pending_invoice_item_invoice: Option<Timestamp>,
148
149    /// The account (if any) the charge was made on behalf of for charges associated with this subscription.
150    ///
151    /// See the Connect documentation for details.
152    pub on_behalf_of: Option<Expandable<Account>>,
153
154    /// If specified, payment collection for this subscription will be paused.
155    pub pause_collection: Option<SubscriptionsResourcePauseCollection>,
156
157    /// Payment settings passed on to invoices created by the subscription.
158    pub payment_settings: Option<SubscriptionsResourcePaymentSettings>,
159
160    /// Specifies an interval for how often to bill for any pending invoice items.
161    ///
162    /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval.
163    pub pending_invoice_item_interval: Option<SubscriptionPendingInvoiceItemInterval>,
164
165    /// You can use this [SetupIntent](https://stripe.com/docs/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments.
166    ///
167    /// Learn more in the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2).
168    pub pending_setup_intent: Option<Expandable<SetupIntent>>,
169
170    /// If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid.
171    pub pending_update: Option<SubscriptionsResourcePendingUpdate>,
172
173    /// The schedule attached to the subscription.
174    pub schedule: Option<Expandable<SubscriptionSchedule>>,
175
176    /// Date when the subscription was first created.
177    ///
178    /// The date might differ from the `created` date due to backdating.
179    pub start_date: Timestamp,
180
181    /// Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`.
182    ///
183    /// For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails.
184    /// A subscription in this state can only have metadata and default_source updated.
185    /// Once the first invoice is paid, the subscription moves into an `active` state.
186    /// If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`.
187    /// This is a terminal state, the open invoice will be voided and no further invoices will be generated.
188    /// A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over.
189    /// If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions).
190    /// Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings).
191    /// If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that.
192    /// Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed).
193    /// After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.
194    pub status: SubscriptionStatus,
195
196    /// ID of the test clock this subscription belongs to.
197    pub test_clock: Option<Expandable<TestHelpersTestClock>>,
198
199    /// The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
200    pub transfer_data: Option<SubscriptionTransferData>,
201
202    /// If the subscription has a trial, the end of that trial.
203    pub trial_end: Option<Timestamp>,
204
205    /// Settings related to subscription trials.
206    pub trial_settings: Option<SubscriptionsTrialsResourceTrialSettings>,
207
208    /// If the subscription has a trial, the beginning of that trial.
209    pub trial_start: Option<Timestamp>,
210}
211
212impl Subscription {
213    /// By default, returns a list of subscriptions that have not been canceled.
214    ///
215    /// In order to list canceled subscriptions, specify `status=canceled`.
216    pub fn list(client: &Client, params: &ListSubscriptions<'_>) -> Response<List<Subscription>> {
217        client.get_query("/subscriptions", params)
218    }
219
220    /// Creates a new subscription on an existing customer.
221    ///
222    /// Each customer can have up to 500 active or scheduled subscriptions.  When you create a subscription with `collection_method=charge_automatically`, the first invoice is finalized as part of the request. The `payment_behavior` parameter determines the exact behavior of the initial payment.  To start subscriptions where the first invoice always begins in a `draft` status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. Schedules provide the flexibility to model more complex billing configurations that change over time.
223    pub fn create(client: &Client, params: CreateSubscription<'_>) -> Response<Subscription> {
224        #[allow(clippy::needless_borrows_for_generic_args)]
225        client.post_form("/subscriptions", &params)
226    }
227
228    /// Retrieves the subscription with the given ID.
229    pub fn retrieve(
230        client: &Client,
231        id: &SubscriptionId,
232        expand: &[&str],
233    ) -> Response<Subscription> {
234        client.get_query(&format!("/subscriptions/{}", id), Expand { expand })
235    }
236
237    /// Updates an existing subscription to match the specified parameters.
238    /// When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.
239    /// To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint.
240    ///
241    /// By default, we prorate subscription changes.
242    ///
243    /// For example, if a customer signs up on May 1 for a $100 price, they’ll be billed $100 immediately.
244    /// If on May 15 they switch to a $200 price, then on June 1 they’ll be billed $250 ($200 for a renewal of her subscription, plus a $50 prorating adjustment for half of the previous month’s $100 difference).
245    /// Similarly, a downgrade generates a credit that is applied to the next invoice.
246    /// We also prorate when you make quantity changes.  Switching prices does not normally change the billing date or generate an immediate charge unless:  <ul> <li>The billing interval is changed (for example, from monthly to yearly).</li> <li>The subscription moves from free to paid, or paid to free.</li> <li>A trial starts or ends.</li> </ul>  In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date.  If you want to charge for an upgrade immediately, pass `proration_behavior` as `always_invoice` to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment.
247    /// If you pass `create_prorations`, the prorations are created but not automatically invoiced.
248    /// If you want to bill the customer for the prorations before the subscription’s renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create).  If you don’t want to prorate, set the `proration_behavior` option to `none`.
249    /// With this option, the customer is billed $100 on May 1 and $200 on June 1.
250    /// Similarly, if you set `proration_behavior` to `none` when switching between different billing intervals (for example, from monthly to yearly), we don’t generate any credits for the old subscription’s unused time.
251    /// We still reset the billing date and bill immediately for the new subscription.  Updating the quantity on a subscription many times in an hour may result in [rate limiting](https://stripe.com/docs/rate-limits).
252    /// If you need to bill for a frequently changing quantity, consider integrating [usage-based billing](https://stripe.com/docs/billing/subscriptions/usage-based) instead.
253    pub fn update(
254        client: &Client,
255        id: &SubscriptionId,
256        params: UpdateSubscription<'_>,
257    ) -> Response<Subscription> {
258        #[allow(clippy::needless_borrows_for_generic_args)]
259        client.post_form(&format!("/subscriptions/{}", id), &params)
260    }
261
262    /// Cancels a customer’s subscription immediately.
263    ///
264    /// The customer will not be charged again for the subscription.  Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem).
265    /// If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period.
266    /// But if the subscription is set to cancel immediately, pending prorations will be removed.  By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer.
267    /// This is intended to prevent unexpected payment attempts after the customer has canceled a subscription.
268    /// However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed.
269    /// Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
270    pub fn delete(client: &Client, id: &SubscriptionId) -> Response<Deleted<SubscriptionId>> {
271        client.delete(&format!("/subscriptions/{}", id))
272    }
273}
274
275impl Object for Subscription {
276    type Id = SubscriptionId;
277    fn id(&self) -> Self::Id {
278        self.id.clone()
279    }
280    fn object(&self) -> &'static str {
281        "subscription"
282    }
283}
284
285#[derive(Clone, Debug, Default, Deserialize, Serialize)]
286pub struct CancellationDetails {
287    /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user.
288    pub comment: Option<String>,
289
290    /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user.
291    pub feedback: Option<CancellationDetailsFeedback>,
292
293    /// Why this subscription was canceled.
294    pub reason: Option<CancellationDetailsReason>,
295}
296
297#[derive(Clone, Debug, Default, Deserialize, Serialize)]
298pub struct SubscriptionAutomaticTax {
299    /// Whether Stripe automatically computes tax on this subscription.
300    pub enabled: bool,
301
302    /// The account that's liable for tax.
303    ///
304    /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account.
305    /// The tax transaction is returned in the report of the connected account.
306    pub liability: Option<ConnectAccountReference>,
307}
308
309#[derive(Clone, Debug, Default, Deserialize, Serialize)]
310pub struct SubscriptionPendingInvoiceItemInterval {
311    /// Specifies invoicing frequency.
312    ///
313    /// Either `day`, `week`, `month` or `year`.
314    pub interval: PlanInterval,
315
316    /// The number of intervals between invoices.
317    ///
318    /// For example, `interval=month` and `interval_count=3` bills every 3 months.
319    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
320    pub interval_count: u64,
321}
322
323#[derive(Clone, Debug, Default, Deserialize, Serialize)]
324pub struct SubscriptionsResourceBillingCycleAnchorConfig {
325    /// The day of the month of the billing_cycle_anchor.
326    pub day_of_month: i64,
327
328    /// The hour of the day of the billing_cycle_anchor.
329    pub hour: Option<i64>,
330
331    /// The minute of the hour of the billing_cycle_anchor.
332    pub minute: Option<i64>,
333
334    /// The month to start full cycle billing periods.
335    pub month: Option<i64>,
336
337    /// The second of the minute of the billing_cycle_anchor.
338    pub second: Option<i64>,
339}
340
341#[derive(Clone, Debug, Default, Deserialize, Serialize)]
342pub struct SubscriptionsResourcePauseCollection {
343    /// The payment collection behavior for this subscription while paused.
344    ///
345    /// One of `keep_as_draft`, `mark_uncollectible`, or `void`.
346    pub behavior: SubscriptionsResourcePauseCollectionBehavior,
347
348    /// The time after which the subscription will resume collecting payments.
349    pub resumes_at: Option<Timestamp>,
350}
351
352#[derive(Clone, Debug, Default, Deserialize, Serialize)]
353pub struct SubscriptionsResourcePaymentSettings {
354    /// Payment-method-specific configuration to provide to invoices created by the subscription.
355    pub payment_method_options: Option<SubscriptionsResourcePaymentMethodOptions>,
356
357    /// The list of payment method types to provide to every invoice created by the subscription.
358    ///
359    /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice).
360    pub payment_method_types: Option<Vec<SubscriptionsResourcePaymentSettingsPaymentMethodTypes>>,
361
362    /// Either `off`, or `on_subscription`.
363    ///
364    /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds.
365    pub save_default_payment_method:
366        Option<SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod>,
367}
368
369#[derive(Clone, Debug, Default, Deserialize, Serialize)]
370pub struct SubscriptionsResourcePaymentMethodOptions {
371    /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to invoices created by the subscription.
372    pub acss_debit: Option<InvoicePaymentMethodOptionsAcssDebit>,
373
374    /// This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription.
375    pub bancontact: Option<InvoicePaymentMethodOptionsBancontact>,
376
377    /// This sub-hash contains details about the Card payment method options to pass to invoices created by the subscription.
378    pub card: Option<SubscriptionPaymentMethodOptionsCard>,
379
380    /// This sub-hash contains details about the Bank transfer payment method options to pass to invoices created by the subscription.
381    pub customer_balance: Option<InvoicePaymentMethodOptionsCustomerBalance>,
382
383    /// This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription.
384    pub konbini: Option<InvoicePaymentMethodOptionsKonbini>,
385
386    /// This sub-hash contains details about the ACH direct debit payment method options to pass to invoices created by the subscription.
387    pub us_bank_account: Option<InvoicePaymentMethodOptionsUsBankAccount>,
388}
389
390#[derive(Clone, Debug, Default, Deserialize, Serialize)]
391pub struct SubscriptionPaymentMethodOptionsCard {
392    #[serde(skip_serializing_if = "Option::is_none")]
393    pub mandate_options: Option<InvoiceMandateOptionsCard>,
394
395    /// Selected network to process this Subscription on.
396    ///
397    /// Depends on the available networks of the card attached to the Subscription.
398    /// Can be only set confirm-time.
399    pub network: Option<SubscriptionPaymentMethodOptionsCardNetwork>,
400
401    /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
402    ///
403    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
404    /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
405    pub request_three_d_secure: Option<SubscriptionPaymentMethodOptionsCardRequestThreeDSecure>,
406}
407
408#[derive(Clone, Debug, Default, Deserialize, Serialize)]
409pub struct InvoiceMandateOptionsCard {
410    /// Amount to be charged for future payments.
411    pub amount: Option<i64>,
412
413    /// One of `fixed` or `maximum`.
414    ///
415    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
416    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
417    pub amount_type: Option<InvoiceMandateOptionsCardAmountType>,
418
419    /// A description of the mandate or subscription that is meant to be displayed to the customer.
420    pub description: Option<String>,
421}
422
423#[derive(Clone, Debug, Default, Deserialize, Serialize)]
424pub struct SubscriptionsResourcePendingUpdate {
425    /// If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices.
426    ///
427    /// The timestamp is in UTC format.
428    pub billing_cycle_anchor: Option<Timestamp>,
429
430    /// The point after which the changes reflected by this update will be discarded and no longer applied.
431    pub expires_at: Timestamp,
432
433    /// List of subscription items, each with an attached plan, that will be set if the update is applied.
434    pub subscription_items: Option<Vec<SubscriptionItem>>,
435
436    /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time, if the update is applied.
437    pub trial_end: Option<Timestamp>,
438
439    /// Indicates if a plan's `trial_period_days` should be applied to the subscription.
440    ///
441    /// Setting `trial_end` per subscription is preferred, and this defaults to `false`.
442    /// Setting this flag to `true` together with `trial_end` is not allowed.
443    /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
444    pub trial_from_plan: Option<bool>,
445}
446
447/// The parameters for `Subscription::create`.
448#[derive(Clone, Debug, Serialize)]
449pub struct CreateSubscription<'a> {
450    /// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription.
451    ///
452    /// You may pass up to 20 items.
453    #[serde(skip_serializing_if = "Option::is_none")]
454    pub add_invoice_items: Option<Vec<AddInvoiceItems>>,
455
456    /// A non-negative decimal between 0 and 100, with at most two decimal places.
457    ///
458    /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.
459    /// The request must be made by a platform account on a connected account in order to set an application fee percentage.
460    /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
461    #[serde(skip_serializing_if = "Option::is_none")]
462    pub application_fee_percent: Option<f64>,
463
464    /// Automatic tax settings for this subscription.
465    ///
466    /// We recommend you only include this parameter when the existing value is being changed.
467    #[serde(skip_serializing_if = "Option::is_none")]
468    pub automatic_tax: Option<CreateSubscriptionAutomaticTax>,
469
470    /// For new subscriptions, a past timestamp to backdate the subscription's start date to.
471    ///
472    /// If set, the first invoice will contain a proration for the timespan between the start date and the current time.
473    /// Can be combined with trials and the billing cycle anchor.
474    #[serde(skip_serializing_if = "Option::is_none")]
475    pub backdate_start_date: Option<Timestamp>,
476
477    /// A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle).
478    ///
479    /// The anchor is the reference point that aligns future billing cycle dates.
480    /// It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals.
481    #[serde(skip_serializing_if = "Option::is_none")]
482    pub billing_cycle_anchor: Option<Timestamp>,
483
484    /// Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals.
485    ///
486    /// When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC.
487    #[serde(skip_serializing_if = "Option::is_none")]
488    pub billing_cycle_anchor_config: Option<CreateSubscriptionBillingCycleAnchorConfig>,
489
490    /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period.
491    ///
492    /// Pass an empty string to remove previously-defined thresholds.
493    #[serde(skip_serializing_if = "Option::is_none")]
494    pub billing_thresholds: Option<SubscriptionBillingThresholds>,
495
496    /// A timestamp at which the subscription should cancel.
497    ///
498    /// If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`.
499    /// If set during a future period, this will always cause a proration for that period.
500    #[serde(skip_serializing_if = "Option::is_none")]
501    pub cancel_at: Option<Timestamp>,
502
503    /// Boolean indicating whether this subscription should cancel at the end of the current period.
504    #[serde(skip_serializing_if = "Option::is_none")]
505    pub cancel_at_period_end: Option<bool>,
506
507    /// Either `charge_automatically`, or `send_invoice`.
508    ///
509    /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer.
510    /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
511    /// Defaults to `charge_automatically`.
512    #[serde(skip_serializing_if = "Option::is_none")]
513    pub collection_method: Option<CollectionMethod>,
514
515    /// The ID of the coupon to apply to this subscription.
516    ///
517    /// A coupon applied to a subscription will only affect invoices created for that particular subscription.
518    #[serde(skip_serializing_if = "Option::is_none")]
519    pub coupon: Option<CouponId>,
520
521    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
522    ///
523    /// Must be a [supported currency](https://stripe.com/docs/currencies).
524    #[serde(skip_serializing_if = "Option::is_none")]
525    pub currency: Option<Currency>,
526
527    /// The identifier of the customer to subscribe.
528    pub customer: CustomerId,
529
530    /// Number of days a customer has to pay invoices generated by this subscription.
531    ///
532    /// Valid only for subscriptions where `collection_method` is set to `send_invoice`.
533    #[serde(skip_serializing_if = "Option::is_none")]
534    pub days_until_due: Option<u32>,
535
536    /// ID of the default payment method for the subscription.
537    ///
538    /// It must belong to the customer associated with the subscription.
539    /// This takes precedence over `default_source`.
540    /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
541    #[serde(skip_serializing_if = "Option::is_none")]
542    pub default_payment_method: Option<&'a str>,
543
544    /// ID of the default payment source for the subscription.
545    ///
546    /// It must belong to the customer associated with the subscription and be in a chargeable state.
547    /// If `default_payment_method` is also set, `default_payment_method` will take precedence.
548    /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
549    #[serde(skip_serializing_if = "Option::is_none")]
550    pub default_source: Option<&'a str>,
551
552    /// The tax rates that will apply to any subscription item that does not have `tax_rates` set.
553    ///
554    /// Invoices created will have their `default_tax_rates` populated from the subscription.
555    #[serde(skip_serializing_if = "Option::is_none")]
556    pub default_tax_rates: Option<Vec<String>>,
557
558    /// The subscription's description, meant to be displayable to the customer.
559    ///
560    /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
561    #[serde(skip_serializing_if = "Option::is_none")]
562    pub description: Option<&'a str>,
563
564    /// Specifies which fields in the response should be expanded.
565    #[serde(skip_serializing_if = "Expand::is_empty")]
566    pub expand: &'a [&'a str],
567
568    /// All invoices will be billed using the specified settings.
569    #[serde(skip_serializing_if = "Option::is_none")]
570    pub invoice_settings: Option<CreateSubscriptionInvoiceSettings>,
571
572    /// A list of up to 20 subscription items, each with an attached price.
573    #[serde(skip_serializing_if = "Option::is_none")]
574    pub items: Option<Vec<CreateSubscriptionItems>>,
575
576    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
577    ///
578    /// This can be useful for storing additional information about the object in a structured format.
579    /// Individual keys can be unset by posting an empty value to them.
580    /// All keys can be unset by posting an empty value to `metadata`.
581    #[serde(skip_serializing_if = "Option::is_none")]
582    pub metadata: Option<Metadata>,
583
584    /// Indicates if a customer is on or off-session while an invoice payment is attempted.
585    #[serde(skip_serializing_if = "Option::is_none")]
586    pub off_session: Option<bool>,
587
588    /// The account on behalf of which to charge, for each of the subscription's invoices.
589    #[serde(skip_serializing_if = "Option::is_none")]
590    pub on_behalf_of: Option<String>,
591
592    /// Only applies to subscriptions with `collection_method=charge_automatically`.
593    ///
594    /// Use `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid.
595    ///
596    /// Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice.
597    /// For example, SCA regulation may require 3DS authentication to complete payment.
598    /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more.
599    /// This is the default behavior.  Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active.
600    /// Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice.
601    /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice.
602    /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method.
603    /// If the payment intent is not confirmed within 23 hours subscriptions transition to `status=incomplete_expired`, which is a terminal state.  Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice cannot be paid.
604    /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead.
605    /// This was the default behavior for API versions prior to 2019-03-14.
606    /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.  `pending_if_incomplete` is only used with updates and cannot be passed when creating a subscription.  Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first invoice status.
607    #[serde(skip_serializing_if = "Option::is_none")]
608    pub payment_behavior: Option<SubscriptionPaymentBehavior>,
609
610    /// Payment settings to pass to invoices created by the subscription.
611    #[serde(skip_serializing_if = "Option::is_none")]
612    pub payment_settings: Option<CreateSubscriptionPaymentSettings>,
613
614    /// Specifies an interval for how often to bill for any pending invoice items.
615    ///
616    /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval.
617    #[serde(skip_serializing_if = "Option::is_none")]
618    pub pending_invoice_item_interval: Option<CreateSubscriptionPendingInvoiceItemInterval>,
619
620    /// The API ID of a promotion code to apply to this subscription.
621    ///
622    /// A promotion code applied to a subscription will only affect invoices created for that particular subscription.
623    #[serde(skip_serializing_if = "Option::is_none")]
624    pub promotion_code: Option<PromotionCodeId>,
625
626    /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`.
627    ///
628    /// If no value is passed, the default is `create_prorations`.
629    #[serde(skip_serializing_if = "Option::is_none")]
630    pub proration_behavior: Option<SubscriptionProrationBehavior>,
631
632    /// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.
633    #[serde(skip_serializing_if = "Option::is_none")]
634    pub transfer_data: Option<CreateSubscriptionTransferData>,
635
636    /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time.
637    ///
638    /// If set, trial_end will override the default trial period of the plan the customer is being subscribed to.
639    /// The special value `now` can be provided to end the customer's trial immediately.
640    /// Can be at most two years from `billing_cycle_anchor`.
641    /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
642    #[serde(skip_serializing_if = "Option::is_none")]
643    pub trial_end: Option<Scheduled>,
644
645    /// Indicates if a plan's `trial_period_days` should be applied to the subscription.
646    ///
647    /// Setting `trial_end` per subscription is preferred, and this defaults to `false`.
648    /// Setting this flag to `true` together with `trial_end` is not allowed.
649    /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
650    #[serde(skip_serializing_if = "Option::is_none")]
651    pub trial_from_plan: Option<bool>,
652
653    /// Integer representing the number of trial period days before the customer is charged for the first time.
654    ///
655    /// This will always overwrite any trials that might apply via a subscribed plan.
656    /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
657    #[serde(skip_serializing_if = "Option::is_none")]
658    pub trial_period_days: Option<u32>,
659
660    /// Settings related to subscription trials.
661    #[serde(skip_serializing_if = "Option::is_none")]
662    pub trial_settings: Option<CreateSubscriptionTrialSettings>,
663}
664
665impl<'a> CreateSubscription<'a> {
666    pub fn new(customer: CustomerId) -> Self {
667        CreateSubscription {
668            add_invoice_items: Default::default(),
669            application_fee_percent: Default::default(),
670            automatic_tax: Default::default(),
671            backdate_start_date: Default::default(),
672            billing_cycle_anchor: Default::default(),
673            billing_cycle_anchor_config: Default::default(),
674            billing_thresholds: Default::default(),
675            cancel_at: Default::default(),
676            cancel_at_period_end: Default::default(),
677            collection_method: Default::default(),
678            coupon: Default::default(),
679            currency: Default::default(),
680            customer,
681            days_until_due: Default::default(),
682            default_payment_method: Default::default(),
683            default_source: Default::default(),
684            default_tax_rates: Default::default(),
685            description: Default::default(),
686            expand: Default::default(),
687            invoice_settings: Default::default(),
688            items: Default::default(),
689            metadata: Default::default(),
690            off_session: Default::default(),
691            on_behalf_of: Default::default(),
692            payment_behavior: Default::default(),
693            payment_settings: Default::default(),
694            pending_invoice_item_interval: Default::default(),
695            promotion_code: Default::default(),
696            proration_behavior: Default::default(),
697            transfer_data: Default::default(),
698            trial_end: Default::default(),
699            trial_from_plan: Default::default(),
700            trial_period_days: Default::default(),
701            trial_settings: Default::default(),
702        }
703    }
704}
705
706/// The parameters for `Subscription::list`.
707#[derive(Clone, Debug, Serialize, Default)]
708pub struct ListSubscriptions<'a> {
709    /// Filter subscriptions by their automatic tax settings.
710    #[serde(skip_serializing_if = "Option::is_none")]
711    pub automatic_tax: Option<ListSubscriptionsAutomaticTax>,
712
713    /// The collection method of the subscriptions to retrieve.
714    ///
715    /// Either `charge_automatically` or `send_invoice`.
716    #[serde(skip_serializing_if = "Option::is_none")]
717    pub collection_method: Option<CollectionMethod>,
718
719    #[serde(skip_serializing_if = "Option::is_none")]
720    pub created: Option<RangeQuery<Timestamp>>,
721
722    #[serde(skip_serializing_if = "Option::is_none")]
723    pub current_period_end: Option<RangeQuery<Timestamp>>,
724
725    #[serde(skip_serializing_if = "Option::is_none")]
726    pub current_period_start: Option<RangeQuery<Timestamp>>,
727
728    /// The ID of the customer whose subscriptions will be retrieved.
729    #[serde(skip_serializing_if = "Option::is_none")]
730    pub customer: Option<CustomerId>,
731
732    /// A cursor for use in pagination.
733    ///
734    /// `ending_before` is an object ID that defines your place in the list.
735    /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
736    #[serde(skip_serializing_if = "Option::is_none")]
737    pub ending_before: Option<SubscriptionId>,
738
739    /// Specifies which fields in the response should be expanded.
740    #[serde(skip_serializing_if = "Expand::is_empty")]
741    pub expand: &'a [&'a str],
742
743    /// A limit on the number of objects to be returned.
744    ///
745    /// Limit can range between 1 and 100, and the default is 10.
746    #[serde(skip_serializing_if = "Option::is_none")]
747    pub limit: Option<u64>,
748
749    /// The ID of the plan whose subscriptions will be retrieved.
750    #[serde(skip_serializing_if = "Option::is_none")]
751    pub plan: Option<PlanId>,
752
753    /// Filter for subscriptions that contain this recurring price ID.
754    #[serde(skip_serializing_if = "Option::is_none")]
755    pub price: Option<PriceId>,
756
757    /// A cursor for use in pagination.
758    ///
759    /// `starting_after` is an object ID that defines your place in the list.
760    /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
761    #[serde(skip_serializing_if = "Option::is_none")]
762    pub starting_after: Option<SubscriptionId>,
763
764    /// The status of the subscriptions to retrieve.
765    ///
766    /// Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers.
767    /// Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses).
768    /// Passing in a value of `all` will return subscriptions of all statuses.
769    /// If no value is supplied, all subscriptions that have not been canceled are returned.
770    #[serde(skip_serializing_if = "Option::is_none")]
771    pub status: Option<SubscriptionStatusFilter>,
772
773    /// Filter for subscriptions that are associated with the specified test clock.
774    ///
775    /// The response will not include subscriptions with test clocks if this and the customer parameter is not set.
776    #[serde(skip_serializing_if = "Option::is_none")]
777    pub test_clock: Option<&'a str>,
778}
779
780impl<'a> ListSubscriptions<'a> {
781    pub fn new() -> Self {
782        ListSubscriptions {
783            automatic_tax: Default::default(),
784            collection_method: Default::default(),
785            created: Default::default(),
786            current_period_end: Default::default(),
787            current_period_start: Default::default(),
788            customer: Default::default(),
789            ending_before: Default::default(),
790            expand: Default::default(),
791            limit: Default::default(),
792            plan: Default::default(),
793            price: Default::default(),
794            starting_after: Default::default(),
795            status: Default::default(),
796            test_clock: Default::default(),
797        }
798    }
799}
800impl Paginable for ListSubscriptions<'_> {
801    type O = Subscription;
802    fn set_last(&mut self, item: Self::O) {
803        self.starting_after = Some(item.id());
804    }
805}
806/// The parameters for `Subscription::update`.
807#[derive(Clone, Debug, Serialize, Default)]
808pub struct UpdateSubscription<'a> {
809    /// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription.
810    ///
811    /// You may pass up to 20 items.
812    #[serde(skip_serializing_if = "Option::is_none")]
813    pub add_invoice_items: Option<Vec<AddInvoiceItems>>,
814
815    /// A non-negative decimal between 0 and 100, with at most two decimal places.
816    ///
817    /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account.
818    /// The request must be made by a platform account on a connected account in order to set an application fee percentage.
819    /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
820    #[serde(skip_serializing_if = "Option::is_none")]
821    pub application_fee_percent: Option<f64>,
822
823    /// Automatic tax settings for this subscription.
824    ///
825    /// We recommend you only include this parameter when the existing value is being changed.
826    #[serde(skip_serializing_if = "Option::is_none")]
827    pub automatic_tax: Option<UpdateSubscriptionAutomaticTax>,
828
829    /// Either `now` or `unchanged`.
830    ///
831    /// Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC).
832    /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
833    #[serde(skip_serializing_if = "Option::is_none")]
834    pub billing_cycle_anchor: Option<SubscriptionBillingCycleAnchor>,
835
836    /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period.
837    ///
838    /// Pass an empty string to remove previously-defined thresholds.
839    #[serde(skip_serializing_if = "Option::is_none")]
840    pub billing_thresholds: Option<SubscriptionBillingThresholds>,
841
842    /// A timestamp at which the subscription should cancel.
843    ///
844    /// If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`.
845    /// If set during a future period, this will always cause a proration for that period.
846    #[serde(skip_serializing_if = "Option::is_none")]
847    pub cancel_at: Option<Timestamp>,
848
849    /// Boolean indicating whether this subscription should cancel at the end of the current period.
850    #[serde(skip_serializing_if = "Option::is_none")]
851    pub cancel_at_period_end: Option<bool>,
852
853    /// Details about why this subscription was cancelled.
854    #[serde(skip_serializing_if = "Option::is_none")]
855    pub cancellation_details: Option<UpdateSubscriptionCancellationDetails>,
856
857    /// Either `charge_automatically`, or `send_invoice`.
858    ///
859    /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer.
860    /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
861    /// Defaults to `charge_automatically`.
862    #[serde(skip_serializing_if = "Option::is_none")]
863    pub collection_method: Option<CollectionMethod>,
864
865    /// The ID of the coupon to apply to this subscription.
866    ///
867    /// A coupon applied to a subscription will only affect invoices created for that particular subscription.
868    #[serde(skip_serializing_if = "Option::is_none")]
869    pub coupon: Option<CouponId>,
870
871    /// Number of days a customer has to pay invoices generated by this subscription.
872    ///
873    /// Valid only for subscriptions where `collection_method` is set to `send_invoice`.
874    #[serde(skip_serializing_if = "Option::is_none")]
875    pub days_until_due: Option<u32>,
876
877    /// ID of the default payment method for the subscription.
878    ///
879    /// It must belong to the customer associated with the subscription.
880    /// This takes precedence over `default_source`.
881    /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
882    #[serde(skip_serializing_if = "Option::is_none")]
883    pub default_payment_method: Option<&'a str>,
884
885    /// ID of the default payment source for the subscription.
886    ///
887    /// It must belong to the customer associated with the subscription and be in a chargeable state.
888    /// If `default_payment_method` is also set, `default_payment_method` will take precedence.
889    /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
890    #[serde(skip_serializing_if = "Option::is_none")]
891    pub default_source: Option<String>,
892
893    /// The tax rates that will apply to any subscription item that does not have `tax_rates` set.
894    ///
895    /// Invoices created will have their `default_tax_rates` populated from the subscription.
896    /// Pass an empty string to remove previously-defined tax rates.
897    #[serde(skip_serializing_if = "Option::is_none")]
898    pub default_tax_rates: Option<Vec<String>>,
899
900    /// The subscription's description, meant to be displayable to the customer.
901    ///
902    /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
903    #[serde(skip_serializing_if = "Option::is_none")]
904    pub description: Option<String>,
905
906    /// Specifies which fields in the response should be expanded.
907    #[serde(skip_serializing_if = "Expand::is_empty")]
908    pub expand: &'a [&'a str],
909
910    /// All invoices will be billed using the specified settings.
911    #[serde(skip_serializing_if = "Option::is_none")]
912    pub invoice_settings: Option<UpdateSubscriptionInvoiceSettings>,
913
914    /// A list of up to 20 subscription items, each with an attached price.
915    #[serde(skip_serializing_if = "Option::is_none")]
916    pub items: Option<Vec<UpdateSubscriptionItems>>,
917
918    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
919    ///
920    /// This can be useful for storing additional information about the object in a structured format.
921    /// Individual keys can be unset by posting an empty value to them.
922    /// All keys can be unset by posting an empty value to `metadata`.
923    #[serde(skip_serializing_if = "Option::is_none")]
924    pub metadata: Option<Metadata>,
925
926    /// Indicates if a customer is on or off-session while an invoice payment is attempted.
927    #[serde(skip_serializing_if = "Option::is_none")]
928    pub off_session: Option<bool>,
929
930    /// The account on behalf of which to charge, for each of the subscription's invoices.
931    #[serde(skip_serializing_if = "Option::is_none")]
932    pub on_behalf_of: Option<String>,
933
934    /// If specified, payment collection for this subscription will be paused.
935    #[serde(skip_serializing_if = "Option::is_none")]
936    pub pause_collection: Option<UpdateSubscriptionPauseCollection>,
937
938    /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid.
939    ///
940    /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice.
941    /// For example, SCA regulation may require 3DS authentication to complete payment.
942    /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more.
943    /// This is the default behavior.  Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent.
944    /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice.
945    /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method.  Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates).
946    /// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).  Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid.
947    /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead.
948    /// This was the default behavior for API versions prior to 2019-03-14.
949    /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.
950    #[serde(skip_serializing_if = "Option::is_none")]
951    pub payment_behavior: Option<SubscriptionPaymentBehavior>,
952
953    /// Payment settings to pass to invoices created by the subscription.
954    #[serde(skip_serializing_if = "Option::is_none")]
955    pub payment_settings: Option<UpdateSubscriptionPaymentSettings>,
956
957    /// Specifies an interval for how often to bill for any pending invoice items.
958    ///
959    /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval.
960    #[serde(skip_serializing_if = "Option::is_none")]
961    pub pending_invoice_item_interval: Option<UpdateSubscriptionPendingInvoiceItemInterval>,
962
963    /// The promotion code to apply to this subscription.
964    ///
965    /// A promotion code applied to a subscription will only affect invoices created for that particular subscription.
966    #[serde(skip_serializing_if = "Option::is_none")]
967    pub promotion_code: Option<PromotionCodeId>,
968
969    /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.
970    ///
971    /// The default value is `create_prorations`.
972    #[serde(skip_serializing_if = "Option::is_none")]
973    pub proration_behavior: Option<SubscriptionProrationBehavior>,
974
975    /// If set, the proration will be calculated as though the subscription was updated at the given time.
976    ///
977    /// This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#upcoming_invoice) endpoint.
978    /// It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.
979    #[serde(skip_serializing_if = "Option::is_none")]
980    pub proration_date: Option<Timestamp>,
981
982    /// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.
983    ///
984    /// This will be unset if you POST an empty value.
985    #[serde(skip_serializing_if = "Option::is_none")]
986    pub transfer_data: Option<UpdateSubscriptionTransferData>,
987
988    /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time.
989    ///
990    /// This will always overwrite any trials that might apply via a subscribed plan.
991    /// If set, trial_end will override the default trial period of the plan the customer is being subscribed to.
992    /// The special value `now` can be provided to end the customer's trial immediately.
993    /// Can be at most two years from `billing_cycle_anchor`.
994    #[serde(skip_serializing_if = "Option::is_none")]
995    pub trial_end: Option<Scheduled>,
996
997    /// Indicates if a plan's `trial_period_days` should be applied to the subscription.
998    ///
999    /// Setting `trial_end` per subscription is preferred, and this defaults to `false`.
1000    /// Setting this flag to `true` together with `trial_end` is not allowed.
1001    /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
1002    #[serde(skip_serializing_if = "Option::is_none")]
1003    pub trial_from_plan: Option<bool>,
1004
1005    /// Settings related to subscription trials.
1006    #[serde(skip_serializing_if = "Option::is_none")]
1007    pub trial_settings: Option<UpdateSubscriptionTrialSettings>,
1008}
1009
1010impl<'a> UpdateSubscription<'a> {
1011    pub fn new() -> Self {
1012        UpdateSubscription {
1013            add_invoice_items: Default::default(),
1014            application_fee_percent: Default::default(),
1015            automatic_tax: Default::default(),
1016            billing_cycle_anchor: Default::default(),
1017            billing_thresholds: Default::default(),
1018            cancel_at: Default::default(),
1019            cancel_at_period_end: Default::default(),
1020            cancellation_details: Default::default(),
1021            collection_method: Default::default(),
1022            coupon: Default::default(),
1023            days_until_due: Default::default(),
1024            default_payment_method: Default::default(),
1025            default_source: Default::default(),
1026            default_tax_rates: Default::default(),
1027            description: Default::default(),
1028            expand: Default::default(),
1029            invoice_settings: Default::default(),
1030            items: Default::default(),
1031            metadata: Default::default(),
1032            off_session: Default::default(),
1033            on_behalf_of: Default::default(),
1034            pause_collection: Default::default(),
1035            payment_behavior: Default::default(),
1036            payment_settings: Default::default(),
1037            pending_invoice_item_interval: Default::default(),
1038            promotion_code: Default::default(),
1039            proration_behavior: Default::default(),
1040            proration_date: Default::default(),
1041            transfer_data: Default::default(),
1042            trial_end: Default::default(),
1043            trial_from_plan: Default::default(),
1044            trial_settings: Default::default(),
1045        }
1046    }
1047}
1048
1049#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1050pub struct AddInvoiceItems {
1051    /// The ID of the price object.
1052    #[serde(skip_serializing_if = "Option::is_none")]
1053    pub price: Option<String>,
1054
1055    /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1056    #[serde(skip_serializing_if = "Option::is_none")]
1057    pub price_data: Option<InvoiceItemPriceData>,
1058
1059    /// Quantity for this item.
1060    ///
1061    /// Defaults to 1.
1062    #[serde(skip_serializing_if = "Option::is_none")]
1063    pub quantity: Option<u64>,
1064
1065    /// The tax rates which apply to the item.
1066    ///
1067    /// When set, the `default_tax_rates` do not apply to this item.
1068    #[serde(skip_serializing_if = "Option::is_none")]
1069    pub tax_rates: Option<Vec<String>>,
1070}
1071
1072#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1073pub struct CreateSubscriptionAutomaticTax {
1074    /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
1075    pub enabled: bool,
1076
1077    /// The account that's liable for tax.
1078    ///
1079    /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account.
1080    /// The tax transaction is returned in the report of the connected account.
1081    #[serde(skip_serializing_if = "Option::is_none")]
1082    pub liability: Option<CreateSubscriptionAutomaticTaxLiability>,
1083}
1084
1085#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1086pub struct CreateSubscriptionBillingCycleAnchorConfig {
1087    /// The day of the month the billing_cycle_anchor should be.
1088    ///
1089    /// Ranges from 1 to 31.
1090    pub day_of_month: i64,
1091
1092    /// The hour of the day the billing_cycle_anchor should be.
1093    ///
1094    /// Ranges from 0 to 23.
1095    #[serde(skip_serializing_if = "Option::is_none")]
1096    pub hour: Option<i64>,
1097
1098    /// The minute of the hour the billing_cycle_anchor should be.
1099    ///
1100    /// Ranges from 0 to 59.
1101    #[serde(skip_serializing_if = "Option::is_none")]
1102    pub minute: Option<i64>,
1103
1104    /// The month to start full cycle billing periods.
1105    ///
1106    /// Ranges from 1 to 12.
1107    #[serde(skip_serializing_if = "Option::is_none")]
1108    pub month: Option<i64>,
1109
1110    /// The second of the minute the billing_cycle_anchor should be.
1111    ///
1112    /// Ranges from 0 to 59.
1113    #[serde(skip_serializing_if = "Option::is_none")]
1114    pub second: Option<i64>,
1115}
1116
1117#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1118pub struct CreateSubscriptionInvoiceSettings {
1119    /// The account tax IDs associated with the subscription.
1120    ///
1121    /// Will be set on invoices generated by the subscription.
1122    #[serde(skip_serializing_if = "Option::is_none")]
1123    pub account_tax_ids: Option<Vec<String>>,
1124
1125    /// The connected account that issues the invoice.
1126    ///
1127    /// The invoice is presented with the branding and support information of the specified account.
1128    #[serde(skip_serializing_if = "Option::is_none")]
1129    pub issuer: Option<CreateSubscriptionInvoiceSettingsIssuer>,
1130}
1131
1132#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1133pub struct CreateSubscriptionItems {
1134    /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period.
1135    ///
1136    /// When updating, pass an empty string to remove previously-defined thresholds.
1137    #[serde(skip_serializing_if = "Option::is_none")]
1138    pub billing_thresholds: Option<CreateSubscriptionItemsBillingThresholds>,
1139
1140    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
1141    ///
1142    /// This can be useful for storing additional information about the object in a structured format.
1143    /// Individual keys can be unset by posting an empty value to them.
1144    /// All keys can be unset by posting an empty value to `metadata`.
1145    #[serde(skip_serializing_if = "Option::is_none")]
1146    pub metadata: Option<Metadata>,
1147
1148    /// Plan ID for this item, as a string.
1149    #[serde(skip_serializing_if = "Option::is_none")]
1150    pub plan: Option<String>,
1151
1152    /// The ID of the price object.
1153    #[serde(skip_serializing_if = "Option::is_none")]
1154    pub price: Option<String>,
1155
1156    /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1157    #[serde(skip_serializing_if = "Option::is_none")]
1158    pub price_data: Option<SubscriptionItemPriceData>,
1159
1160    /// Quantity for this item.
1161    #[serde(skip_serializing_if = "Option::is_none")]
1162    pub quantity: Option<u64>,
1163
1164    /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids.
1165    ///
1166    /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription.
1167    /// When updating, pass an empty string to remove previously-defined tax rates.
1168    #[serde(skip_serializing_if = "Option::is_none")]
1169    pub tax_rates: Option<Vec<String>>,
1170}
1171
1172#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1173pub struct CreateSubscriptionPaymentSettings {
1174    /// Payment-method-specific configuration to provide to invoices created by the subscription.
1175    #[serde(skip_serializing_if = "Option::is_none")]
1176    pub payment_method_options: Option<CreateSubscriptionPaymentSettingsPaymentMethodOptions>,
1177
1178    /// The list of payment method types (e.g.
1179    ///
1180    /// card) to provide to the invoice’s PaymentIntent.
1181    /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice).
1182    #[serde(skip_serializing_if = "Option::is_none")]
1183    pub payment_method_types: Option<Vec<CreateSubscriptionPaymentSettingsPaymentMethodTypes>>,
1184
1185    /// Either `off`, or `on_subscription`.
1186    ///
1187    /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds.
1188    #[serde(skip_serializing_if = "Option::is_none")]
1189    pub save_default_payment_method:
1190        Option<CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod>,
1191}
1192
1193#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1194pub struct CreateSubscriptionPendingInvoiceItemInterval {
1195    /// Specifies invoicing frequency.
1196    ///
1197    /// Either `day`, `week`, `month` or `year`.
1198    pub interval: PlanInterval,
1199
1200    /// The number of intervals between invoices.
1201    ///
1202    /// For example, `interval=month` and `interval_count=3` bills every 3 months.
1203    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
1204    #[serde(skip_serializing_if = "Option::is_none")]
1205    pub interval_count: Option<u64>,
1206}
1207
1208#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1209pub struct CreateSubscriptionTransferData {
1210    /// A non-negative decimal between 0 and 100, with at most two decimal places.
1211    ///
1212    /// This represents the percentage of the subscription invoice total that will be transferred to the destination account.
1213    /// By default, the entire amount is transferred to the destination.
1214    #[serde(skip_serializing_if = "Option::is_none")]
1215    pub amount_percent: Option<f64>,
1216
1217    /// ID of an existing, connected Stripe account.
1218    pub destination: String,
1219}
1220
1221#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1222pub struct CreateSubscriptionTrialSettings {
1223    /// Defines how the subscription should behave when the user's free trial ends.
1224    pub end_behavior: CreateSubscriptionTrialSettingsEndBehavior,
1225}
1226
1227#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1228pub struct ListSubscriptionsAutomaticTax {
1229    /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
1230    pub enabled: bool,
1231}
1232
1233#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1234pub struct UpdateSubscriptionAutomaticTax {
1235    /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
1236    pub enabled: bool,
1237
1238    /// The account that's liable for tax.
1239    ///
1240    /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account.
1241    /// The tax transaction is returned in the report of the connected account.
1242    #[serde(skip_serializing_if = "Option::is_none")]
1243    pub liability: Option<UpdateSubscriptionAutomaticTaxLiability>,
1244}
1245
1246#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1247pub struct UpdateSubscriptionCancellationDetails {
1248    /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user.
1249    #[serde(skip_serializing_if = "Option::is_none")]
1250    pub comment: Option<String>,
1251
1252    /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user.
1253    #[serde(skip_serializing_if = "Option::is_none")]
1254    pub feedback: Option<UpdateSubscriptionCancellationDetailsFeedback>,
1255}
1256
1257#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1258pub struct UpdateSubscriptionInvoiceSettings {
1259    /// The account tax IDs associated with the subscription.
1260    ///
1261    /// Will be set on invoices generated by the subscription.
1262    #[serde(skip_serializing_if = "Option::is_none")]
1263    pub account_tax_ids: Option<Vec<String>>,
1264
1265    /// The connected account that issues the invoice.
1266    ///
1267    /// The invoice is presented with the branding and support information of the specified account.
1268    #[serde(skip_serializing_if = "Option::is_none")]
1269    pub issuer: Option<UpdateSubscriptionInvoiceSettingsIssuer>,
1270}
1271
1272#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1273pub struct UpdateSubscriptionItems {
1274    /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period.
1275    ///
1276    /// When updating, pass an empty string to remove previously-defined thresholds.
1277    #[serde(skip_serializing_if = "Option::is_none")]
1278    pub billing_thresholds: Option<SubscriptionItemBillingThresholds>,
1279
1280    /// Delete all usage for a given subscription item.
1281    ///
1282    /// Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`.
1283    #[serde(skip_serializing_if = "Option::is_none")]
1284    pub clear_usage: Option<bool>,
1285
1286    /// A flag that, if set to `true`, will delete the specified item.
1287    #[serde(skip_serializing_if = "Option::is_none")]
1288    pub deleted: Option<bool>,
1289
1290    /// Subscription item to update.
1291    #[serde(skip_serializing_if = "Option::is_none")]
1292    pub id: Option<String>,
1293
1294    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
1295    ///
1296    /// This can be useful for storing additional information about the object in a structured format.
1297    /// Individual keys can be unset by posting an empty value to them.
1298    /// All keys can be unset by posting an empty value to `metadata`.
1299    #[serde(skip_serializing_if = "Option::is_none")]
1300    pub metadata: Option<Metadata>,
1301
1302    /// Plan ID for this item, as a string.
1303    #[serde(skip_serializing_if = "Option::is_none")]
1304    pub plan: Option<String>,
1305
1306    /// The ID of the price object.
1307    ///
1308    /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.
1309    #[serde(skip_serializing_if = "Option::is_none")]
1310    pub price: Option<String>,
1311
1312    /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1313    #[serde(skip_serializing_if = "Option::is_none")]
1314    pub price_data: Option<SubscriptionItemPriceData>,
1315
1316    /// Quantity for this item.
1317    #[serde(skip_serializing_if = "Option::is_none")]
1318    pub quantity: Option<u64>,
1319
1320    /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids.
1321    ///
1322    /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription.
1323    /// When updating, pass an empty string to remove previously-defined tax rates.
1324    #[serde(skip_serializing_if = "Option::is_none")]
1325    pub tax_rates: Option<Vec<String>>,
1326}
1327
1328#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1329pub struct UpdateSubscriptionPauseCollection {
1330    /// The payment collection behavior for this subscription while paused.
1331    ///
1332    /// One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1333    pub behavior: UpdateSubscriptionPauseCollectionBehavior,
1334
1335    /// The time after which the subscription will resume collecting payments.
1336    #[serde(skip_serializing_if = "Option::is_none")]
1337    pub resumes_at: Option<Timestamp>,
1338}
1339
1340#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1341pub struct UpdateSubscriptionPaymentSettings {
1342    /// Payment-method-specific configuration to provide to invoices created by the subscription.
1343    #[serde(skip_serializing_if = "Option::is_none")]
1344    pub payment_method_options: Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptions>,
1345
1346    /// The list of payment method types (e.g.
1347    ///
1348    /// card) to provide to the invoice’s PaymentIntent.
1349    /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice).
1350    #[serde(skip_serializing_if = "Option::is_none")]
1351    pub payment_method_types: Option<Vec<UpdateSubscriptionPaymentSettingsPaymentMethodTypes>>,
1352
1353    /// Either `off`, or `on_subscription`.
1354    ///
1355    /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds.
1356    #[serde(skip_serializing_if = "Option::is_none")]
1357    pub save_default_payment_method:
1358        Option<UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod>,
1359}
1360
1361#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1362pub struct UpdateSubscriptionPendingInvoiceItemInterval {
1363    /// Specifies invoicing frequency.
1364    ///
1365    /// Either `day`, `week`, `month` or `year`.
1366    pub interval: PlanInterval,
1367
1368    /// The number of intervals between invoices.
1369    ///
1370    /// For example, `interval=month` and `interval_count=3` bills every 3 months.
1371    /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
1372    #[serde(skip_serializing_if = "Option::is_none")]
1373    pub interval_count: Option<u64>,
1374}
1375
1376#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1377pub struct UpdateSubscriptionTransferData {
1378    /// A non-negative decimal between 0 and 100, with at most two decimal places.
1379    ///
1380    /// This represents the percentage of the subscription invoice total that will be transferred to the destination account.
1381    /// By default, the entire amount is transferred to the destination.
1382    #[serde(skip_serializing_if = "Option::is_none")]
1383    pub amount_percent: Option<f64>,
1384
1385    /// ID of an existing, connected Stripe account.
1386    pub destination: String,
1387}
1388
1389#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1390pub struct UpdateSubscriptionTrialSettings {
1391    /// Defines how the subscription should behave when the user's free trial ends.
1392    pub end_behavior: UpdateSubscriptionTrialSettingsEndBehavior,
1393}
1394
1395#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1396pub struct CreateSubscriptionAutomaticTaxLiability {
1397    /// The connected account being referenced when `type` is `account`.
1398    #[serde(skip_serializing_if = "Option::is_none")]
1399    pub account: Option<String>,
1400
1401    /// Type of the account referenced in the request.
1402    #[serde(rename = "type")]
1403    pub type_: CreateSubscriptionAutomaticTaxLiabilityType,
1404}
1405
1406#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1407pub struct CreateSubscriptionInvoiceSettingsIssuer {
1408    /// The connected account being referenced when `type` is `account`.
1409    #[serde(skip_serializing_if = "Option::is_none")]
1410    pub account: Option<String>,
1411
1412    /// Type of the account referenced in the request.
1413    #[serde(rename = "type")]
1414    pub type_: CreateSubscriptionInvoiceSettingsIssuerType,
1415}
1416
1417#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1418pub struct CreateSubscriptionItemsBillingThresholds {
1419    /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)).
1420    pub usage_gte: i64,
1421}
1422
1423#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1424pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptions {
1425    /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
1426    #[serde(skip_serializing_if = "Option::is_none")]
1427    pub acss_debit: Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit>,
1428
1429    /// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
1430    #[serde(skip_serializing_if = "Option::is_none")]
1431    pub bancontact: Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact>,
1432
1433    /// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
1434    #[serde(skip_serializing_if = "Option::is_none")]
1435    pub card: Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard>,
1436
1437    /// This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1438    #[serde(skip_serializing_if = "Option::is_none")]
1439    pub customer_balance:
1440        Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance>,
1441
1442    /// This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1443    #[serde(skip_serializing_if = "Option::is_none")]
1444    pub konbini: Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsKonbini>,
1445
1446    /// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
1447    #[serde(skip_serializing_if = "Option::is_none")]
1448    pub us_bank_account: Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount>,
1449}
1450
1451#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1452pub struct CreateSubscriptionTrialSettingsEndBehavior {
1453    /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
1454    pub missing_payment_method: CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod,
1455}
1456
1457#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1458pub struct InvoiceItemPriceData {
1459    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
1460    ///
1461    /// Must be a [supported currency](https://stripe.com/docs/currencies).
1462    pub currency: Currency,
1463
1464    /// The ID of the product that this price will belong to.
1465    pub product: String,
1466
1467    /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings.
1468    ///
1469    /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes.
1470    /// One of `inclusive`, `exclusive`, or `unspecified`.
1471    /// Once specified as either `inclusive` or `exclusive`, it cannot be changed.
1472    #[serde(skip_serializing_if = "Option::is_none")]
1473    pub tax_behavior: Option<InvoiceItemPriceDataTaxBehavior>,
1474
1475    /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
1476    #[serde(skip_serializing_if = "Option::is_none")]
1477    pub unit_amount: Option<i64>,
1478
1479    /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places.
1480    ///
1481    /// Only one of `unit_amount` and `unit_amount_decimal` can be set.
1482    #[serde(skip_serializing_if = "Option::is_none")]
1483    pub unit_amount_decimal: Option<String>,
1484}
1485
1486#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1487pub struct SubscriptionItemPriceData {
1488    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
1489    ///
1490    /// Must be a [supported currency](https://stripe.com/docs/currencies).
1491    pub currency: Currency,
1492
1493    /// The ID of the product that this price will belong to.
1494    pub product: String,
1495
1496    /// The recurring components of a price such as `interval` and `interval_count`.
1497    pub recurring: SubscriptionItemPriceDataRecurring,
1498
1499    /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings.
1500    ///
1501    /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes.
1502    /// One of `inclusive`, `exclusive`, or `unspecified`.
1503    /// Once specified as either `inclusive` or `exclusive`, it cannot be changed.
1504    #[serde(skip_serializing_if = "Option::is_none")]
1505    pub tax_behavior: Option<SubscriptionItemPriceDataTaxBehavior>,
1506
1507    /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
1508    #[serde(skip_serializing_if = "Option::is_none")]
1509    pub unit_amount: Option<i64>,
1510
1511    /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places.
1512    ///
1513    /// Only one of `unit_amount` and `unit_amount_decimal` can be set.
1514    #[serde(skip_serializing_if = "Option::is_none")]
1515    pub unit_amount_decimal: Option<String>,
1516}
1517
1518#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1519pub struct UpdateSubscriptionAutomaticTaxLiability {
1520    /// The connected account being referenced when `type` is `account`.
1521    #[serde(skip_serializing_if = "Option::is_none")]
1522    pub account: Option<String>,
1523
1524    /// Type of the account referenced in the request.
1525    #[serde(rename = "type")]
1526    pub type_: UpdateSubscriptionAutomaticTaxLiabilityType,
1527}
1528
1529#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1530pub struct UpdateSubscriptionInvoiceSettingsIssuer {
1531    /// The connected account being referenced when `type` is `account`.
1532    #[serde(skip_serializing_if = "Option::is_none")]
1533    pub account: Option<String>,
1534
1535    /// Type of the account referenced in the request.
1536    #[serde(rename = "type")]
1537    pub type_: UpdateSubscriptionInvoiceSettingsIssuerType,
1538}
1539
1540#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1541pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptions {
1542    /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
1543    #[serde(skip_serializing_if = "Option::is_none")]
1544    pub acss_debit: Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit>,
1545
1546    /// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
1547    #[serde(skip_serializing_if = "Option::is_none")]
1548    pub bancontact: Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact>,
1549
1550    /// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
1551    #[serde(skip_serializing_if = "Option::is_none")]
1552    pub card: Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard>,
1553
1554    /// This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1555    #[serde(skip_serializing_if = "Option::is_none")]
1556    pub customer_balance:
1557        Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance>,
1558
1559    /// This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1560    #[serde(skip_serializing_if = "Option::is_none")]
1561    pub konbini: Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsKonbini>,
1562
1563    /// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
1564    #[serde(skip_serializing_if = "Option::is_none")]
1565    pub us_bank_account: Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount>,
1566}
1567
1568#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1569pub struct UpdateSubscriptionTrialSettingsEndBehavior {
1570    /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
1571    pub missing_payment_method: UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod,
1572}
1573
1574#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1575pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit {
1576    /// Additional fields for Mandate creation.
1577    #[serde(skip_serializing_if = "Option::is_none")]
1578    pub mandate_options:
1579        Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions>,
1580
1581    /// Verification method for the intent.
1582    #[serde(skip_serializing_if = "Option::is_none")]
1583    pub verification_method:
1584        Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod>,
1585}
1586
1587#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1588pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact {
1589    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
1590    #[serde(skip_serializing_if = "Option::is_none")]
1591    pub preferred_language:
1592        Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage>,
1593}
1594
1595#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1596pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard {
1597    /// Configuration options for setting up an eMandate for cards issued in India.
1598    #[serde(skip_serializing_if = "Option::is_none")]
1599    pub mandate_options:
1600        Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions>,
1601
1602    /// Selected network to process this Subscription on.
1603    ///
1604    /// Depends on the available networks of the card attached to the Subscription.
1605    /// Can be only set confirm-time.
1606    #[serde(skip_serializing_if = "Option::is_none")]
1607    pub network: Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork>,
1608
1609    /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
1610    ///
1611    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
1612    /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
1613    #[serde(skip_serializing_if = "Option::is_none")]
1614    pub request_three_d_secure:
1615        Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure>,
1616}
1617
1618#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1619pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance {
1620    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
1621    #[serde(skip_serializing_if = "Option::is_none")]
1622    pub bank_transfer:
1623        Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer>,
1624
1625    /// The funding method type to be used when there are not enough funds in the customer balance.
1626    ///
1627    /// Permitted values include: `bank_transfer`.
1628    #[serde(skip_serializing_if = "Option::is_none")]
1629    pub funding_type: Option<String>,
1630}
1631
1632#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1633pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsKonbini {}
1634
1635#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1636pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount {
1637    /// Additional fields for Financial Connections Session creation.
1638    #[serde(skip_serializing_if = "Option::is_none")]
1639    pub financial_connections: Option<
1640        CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections,
1641    >,
1642
1643    /// Verification method for the intent.
1644    #[serde(skip_serializing_if = "Option::is_none")]
1645    pub verification_method: Option<
1646        CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod,
1647    >,
1648}
1649
1650#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1651pub struct SubscriptionItemPriceDataRecurring {
1652    /// Specifies billing frequency.
1653    ///
1654    /// Either `day`, `week`, `month` or `year`.
1655    pub interval: PlanInterval,
1656
1657    /// The number of intervals between subscription billings.
1658    ///
1659    /// For example, `interval=month` and `interval_count=3` bills every 3 months.
1660    /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
1661    #[serde(skip_serializing_if = "Option::is_none")]
1662    pub interval_count: Option<u64>,
1663}
1664
1665#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1666pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit {
1667    /// Additional fields for Mandate creation.
1668    #[serde(skip_serializing_if = "Option::is_none")]
1669    pub mandate_options:
1670        Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions>,
1671
1672    /// Verification method for the intent.
1673    #[serde(skip_serializing_if = "Option::is_none")]
1674    pub verification_method:
1675        Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod>,
1676}
1677
1678#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1679pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact {
1680    /// Preferred language of the Bancontact authorization page that the customer is redirected to.
1681    #[serde(skip_serializing_if = "Option::is_none")]
1682    pub preferred_language:
1683        Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage>,
1684}
1685
1686#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1687pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard {
1688    /// Configuration options for setting up an eMandate for cards issued in India.
1689    #[serde(skip_serializing_if = "Option::is_none")]
1690    pub mandate_options:
1691        Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions>,
1692
1693    /// Selected network to process this Subscription on.
1694    ///
1695    /// Depends on the available networks of the card attached to the Subscription.
1696    /// Can be only set confirm-time.
1697    #[serde(skip_serializing_if = "Option::is_none")]
1698    pub network: Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork>,
1699
1700    /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication).
1701    ///
1702    /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option.
1703    /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
1704    #[serde(skip_serializing_if = "Option::is_none")]
1705    pub request_three_d_secure:
1706        Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure>,
1707}
1708
1709#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1710pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance {
1711    /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
1712    #[serde(skip_serializing_if = "Option::is_none")]
1713    pub bank_transfer:
1714        Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer>,
1715
1716    /// The funding method type to be used when there are not enough funds in the customer balance.
1717    ///
1718    /// Permitted values include: `bank_transfer`.
1719    #[serde(skip_serializing_if = "Option::is_none")]
1720    pub funding_type: Option<String>,
1721}
1722
1723#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1724pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsKonbini {}
1725
1726#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1727pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount {
1728    /// Additional fields for Financial Connections Session creation.
1729    #[serde(skip_serializing_if = "Option::is_none")]
1730    pub financial_connections: Option<
1731        UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections,
1732    >,
1733
1734    /// Verification method for the intent.
1735    #[serde(skip_serializing_if = "Option::is_none")]
1736    pub verification_method: Option<
1737        UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod,
1738    >,
1739}
1740
1741#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1742pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions {
1743    /// Transaction type of the mandate.
1744    #[serde(skip_serializing_if = "Option::is_none")]
1745    pub transaction_type: Option<
1746        CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType,
1747    >,
1748}
1749
1750#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1751pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions {
1752    /// Amount to be charged for future payments.
1753    #[serde(skip_serializing_if = "Option::is_none")]
1754    pub amount: Option<i64>,
1755
1756    /// One of `fixed` or `maximum`.
1757    ///
1758    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
1759    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
1760    #[serde(skip_serializing_if = "Option::is_none")]
1761    pub amount_type:
1762        Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType>,
1763
1764    /// A description of the mandate or subscription that is meant to be displayed to the customer.
1765    #[serde(skip_serializing_if = "Option::is_none")]
1766    pub description: Option<String>,
1767}
1768
1769#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1770pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer {
1771
1772    /// Configuration for eu_bank_transfer funding type.
1773    #[serde(skip_serializing_if = "Option::is_none")]
1774    pub eu_bank_transfer: Option<CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer>,
1775
1776    /// The bank transfer type that can be used for funding.
1777    ///
1778    /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
1779    #[serde(rename = "type")]
1780    #[serde(skip_serializing_if = "Option::is_none")]
1781    pub type_: Option<String>,
1782}
1783
1784#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1785pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections {
1786
1787    /// The list of permissions to request.
1788    ///
1789    /// If this parameter is passed, the `payment_method` permission must be included.
1790    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
1791    #[serde(skip_serializing_if = "Option::is_none")]
1792    pub permissions: Option<Vec<CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>>,
1793
1794    /// List of data features that you would like to retrieve upon account creation.
1795    #[serde(skip_serializing_if = "Option::is_none")]
1796    pub prefetch: Option<Vec<CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
1797}
1798
1799#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1800pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions {
1801    /// Transaction type of the mandate.
1802    #[serde(skip_serializing_if = "Option::is_none")]
1803    pub transaction_type: Option<
1804        UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType,
1805    >,
1806}
1807
1808#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1809pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions {
1810    /// Amount to be charged for future payments.
1811    #[serde(skip_serializing_if = "Option::is_none")]
1812    pub amount: Option<i64>,
1813
1814    /// One of `fixed` or `maximum`.
1815    ///
1816    /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments.
1817    /// If `maximum`, the amount charged can be up to the value passed for the `amount` param.
1818    #[serde(skip_serializing_if = "Option::is_none")]
1819    pub amount_type:
1820        Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType>,
1821
1822    /// A description of the mandate or subscription that is meant to be displayed to the customer.
1823    #[serde(skip_serializing_if = "Option::is_none")]
1824    pub description: Option<String>,
1825}
1826
1827#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1828pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer {
1829
1830    /// Configuration for eu_bank_transfer funding type.
1831    #[serde(skip_serializing_if = "Option::is_none")]
1832    pub eu_bank_transfer: Option<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer>,
1833
1834    /// The bank transfer type that can be used for funding.
1835    ///
1836    /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
1837    #[serde(rename = "type")]
1838    #[serde(skip_serializing_if = "Option::is_none")]
1839    pub type_: Option<String>,
1840}
1841
1842#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1843pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections {
1844
1845    /// The list of permissions to request.
1846    ///
1847    /// If this parameter is passed, the `payment_method` permission must be included.
1848    /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
1849    #[serde(skip_serializing_if = "Option::is_none")]
1850    pub permissions: Option<Vec<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions>>,
1851
1852    /// List of data features that you would like to retrieve upon account creation.
1853    #[serde(skip_serializing_if = "Option::is_none")]
1854    pub prefetch: Option<Vec<UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch>>,
1855}
1856
1857#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1858pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer
1859{
1860    /// The desired country code of the bank account information.
1861    ///
1862    /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
1863    pub country: String,
1864}
1865
1866#[derive(Clone, Debug, Default, Deserialize, Serialize)]
1867pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer
1868{
1869    /// The desired country code of the bank account information.
1870    ///
1871    /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
1872    pub country: String,
1873}
1874
1875/// An enum representing the possible values of an `CancellationDetails`'s `feedback` field.
1876#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1877#[serde(rename_all = "snake_case")]
1878pub enum CancellationDetailsFeedback {
1879    CustomerService,
1880    LowQuality,
1881    MissingFeatures,
1882    Other,
1883    SwitchedService,
1884    TooComplex,
1885    TooExpensive,
1886    Unused,
1887}
1888
1889impl CancellationDetailsFeedback {
1890    pub fn as_str(self) -> &'static str {
1891        match self {
1892            CancellationDetailsFeedback::CustomerService => "customer_service",
1893            CancellationDetailsFeedback::LowQuality => "low_quality",
1894            CancellationDetailsFeedback::MissingFeatures => "missing_features",
1895            CancellationDetailsFeedback::Other => "other",
1896            CancellationDetailsFeedback::SwitchedService => "switched_service",
1897            CancellationDetailsFeedback::TooComplex => "too_complex",
1898            CancellationDetailsFeedback::TooExpensive => "too_expensive",
1899            CancellationDetailsFeedback::Unused => "unused",
1900        }
1901    }
1902}
1903
1904impl AsRef<str> for CancellationDetailsFeedback {
1905    fn as_ref(&self) -> &str {
1906        self.as_str()
1907    }
1908}
1909
1910impl std::fmt::Display for CancellationDetailsFeedback {
1911    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1912        self.as_str().fmt(f)
1913    }
1914}
1915impl std::default::Default for CancellationDetailsFeedback {
1916    fn default() -> Self {
1917        Self::CustomerService
1918    }
1919}
1920
1921/// An enum representing the possible values of an `CancellationDetails`'s `reason` field.
1922#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1923#[serde(rename_all = "snake_case")]
1924pub enum CancellationDetailsReason {
1925    CancellationRequested,
1926    PaymentDisputed,
1927    PaymentFailed,
1928}
1929
1930impl CancellationDetailsReason {
1931    pub fn as_str(self) -> &'static str {
1932        match self {
1933            CancellationDetailsReason::CancellationRequested => "cancellation_requested",
1934            CancellationDetailsReason::PaymentDisputed => "payment_disputed",
1935            CancellationDetailsReason::PaymentFailed => "payment_failed",
1936        }
1937    }
1938}
1939
1940impl AsRef<str> for CancellationDetailsReason {
1941    fn as_ref(&self) -> &str {
1942        self.as_str()
1943    }
1944}
1945
1946impl std::fmt::Display for CancellationDetailsReason {
1947    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1948        self.as_str().fmt(f)
1949    }
1950}
1951impl std::default::Default for CancellationDetailsReason {
1952    fn default() -> Self {
1953        Self::CancellationRequested
1954    }
1955}
1956
1957/// An enum representing the possible values of an `CreateSubscriptionAutomaticTaxLiability`'s `type` field.
1958#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1959#[serde(rename_all = "snake_case")]
1960pub enum CreateSubscriptionAutomaticTaxLiabilityType {
1961    Account,
1962    #[serde(rename = "self")]
1963    Self_,
1964}
1965
1966impl CreateSubscriptionAutomaticTaxLiabilityType {
1967    pub fn as_str(self) -> &'static str {
1968        match self {
1969            CreateSubscriptionAutomaticTaxLiabilityType::Account => "account",
1970            CreateSubscriptionAutomaticTaxLiabilityType::Self_ => "self",
1971        }
1972    }
1973}
1974
1975impl AsRef<str> for CreateSubscriptionAutomaticTaxLiabilityType {
1976    fn as_ref(&self) -> &str {
1977        self.as_str()
1978    }
1979}
1980
1981impl std::fmt::Display for CreateSubscriptionAutomaticTaxLiabilityType {
1982    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1983        self.as_str().fmt(f)
1984    }
1985}
1986impl std::default::Default for CreateSubscriptionAutomaticTaxLiabilityType {
1987    fn default() -> Self {
1988        Self::Account
1989    }
1990}
1991
1992/// An enum representing the possible values of an `CreateSubscriptionInvoiceSettingsIssuer`'s `type` field.
1993#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
1994#[serde(rename_all = "snake_case")]
1995pub enum CreateSubscriptionInvoiceSettingsIssuerType {
1996    Account,
1997    #[serde(rename = "self")]
1998    Self_,
1999}
2000
2001impl CreateSubscriptionInvoiceSettingsIssuerType {
2002    pub fn as_str(self) -> &'static str {
2003        match self {
2004            CreateSubscriptionInvoiceSettingsIssuerType::Account => "account",
2005            CreateSubscriptionInvoiceSettingsIssuerType::Self_ => "self",
2006        }
2007    }
2008}
2009
2010impl AsRef<str> for CreateSubscriptionInvoiceSettingsIssuerType {
2011    fn as_ref(&self) -> &str {
2012        self.as_str()
2013    }
2014}
2015
2016impl std::fmt::Display for CreateSubscriptionInvoiceSettingsIssuerType {
2017    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2018        self.as_str().fmt(f)
2019    }
2020}
2021impl std::default::Default for CreateSubscriptionInvoiceSettingsIssuerType {
2022    fn default() -> Self {
2023        Self::Account
2024    }
2025}
2026
2027/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field.
2028#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2029#[serde(rename_all = "snake_case")]
2030pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2031{
2032    Business,
2033    Personal,
2034}
2035
2036impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
2037    pub fn as_str(self) -> &'static str {
2038        match self {
2039            CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business",
2040            CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal",
2041        }
2042    }
2043}
2044
2045impl AsRef<str>
2046    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2047{
2048    fn as_ref(&self) -> &str {
2049        self.as_str()
2050    }
2051}
2052
2053impl std::fmt::Display
2054    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2055{
2056    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2057        self.as_str().fmt(f)
2058    }
2059}
2060impl std::default::Default
2061    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
2062{
2063    fn default() -> Self {
2064        Self::Business
2065    }
2066}
2067
2068/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit`'s `verification_method` field.
2069#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2070#[serde(rename_all = "snake_case")]
2071pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod {
2072    Automatic,
2073    Instant,
2074    Microdeposits,
2075}
2076
2077impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod {
2078    pub fn as_str(self) -> &'static str {
2079        match self {
2080            CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic",
2081            CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant",
2082            CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => "microdeposits",
2083        }
2084    }
2085}
2086
2087impl AsRef<str>
2088    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod
2089{
2090    fn as_ref(&self) -> &str {
2091        self.as_str()
2092    }
2093}
2094
2095impl std::fmt::Display
2096    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod
2097{
2098    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2099        self.as_str().fmt(f)
2100    }
2101}
2102impl std::default::Default
2103    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod
2104{
2105    fn default() -> Self {
2106        Self::Automatic
2107    }
2108}
2109
2110/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact`'s `preferred_language` field.
2111#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2112#[serde(rename_all = "snake_case")]
2113pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage {
2114    De,
2115    En,
2116    Fr,
2117    Nl,
2118}
2119
2120impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage {
2121    pub fn as_str(self) -> &'static str {
2122        match self {
2123            CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::De => "de",
2124            CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::En => "en",
2125            CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr",
2126            CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl",
2127        }
2128    }
2129}
2130
2131impl AsRef<str>
2132    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage
2133{
2134    fn as_ref(&self) -> &str {
2135        self.as_str()
2136    }
2137}
2138
2139impl std::fmt::Display
2140    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage
2141{
2142    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2143        self.as_str().fmt(f)
2144    }
2145}
2146impl std::default::Default
2147    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage
2148{
2149    fn default() -> Self {
2150        Self::De
2151    }
2152}
2153
2154/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions`'s `amount_type` field.
2155#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2156#[serde(rename_all = "snake_case")]
2157pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType {
2158    Fixed,
2159    Maximum,
2160}
2161
2162impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType {
2163    pub fn as_str(self) -> &'static str {
2164        match self {
2165            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed",
2166            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum",
2167        }
2168    }
2169}
2170
2171impl AsRef<str>
2172    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType
2173{
2174    fn as_ref(&self) -> &str {
2175        self.as_str()
2176    }
2177}
2178
2179impl std::fmt::Display
2180    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType
2181{
2182    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2183        self.as_str().fmt(f)
2184    }
2185}
2186impl std::default::Default
2187    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType
2188{
2189    fn default() -> Self {
2190        Self::Fixed
2191    }
2192}
2193
2194/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard`'s `network` field.
2195#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2196#[serde(rename_all = "snake_case")]
2197pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork {
2198    Amex,
2199    CartesBancaires,
2200    Diners,
2201    Discover,
2202    EftposAu,
2203    Interac,
2204    Jcb,
2205    Mastercard,
2206    Unionpay,
2207    Unknown,
2208    Visa,
2209}
2210
2211impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork {
2212    pub fn as_str(self) -> &'static str {
2213        match self {
2214            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Amex => "amex",
2215            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::CartesBancaires => {
2216                "cartes_bancaires"
2217            }
2218            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Diners => "diners",
2219            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Discover => {
2220                "discover"
2221            }
2222            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::EftposAu => {
2223                "eftpos_au"
2224            }
2225            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Interac => "interac",
2226            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Jcb => "jcb",
2227            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Mastercard => {
2228                "mastercard"
2229            }
2230            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Unionpay => {
2231                "unionpay"
2232            }
2233            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Unknown => "unknown",
2234            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Visa => "visa",
2235        }
2236    }
2237}
2238
2239impl AsRef<str> for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork {
2240    fn as_ref(&self) -> &str {
2241        self.as_str()
2242    }
2243}
2244
2245impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork {
2246    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2247        self.as_str().fmt(f)
2248    }
2249}
2250impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork {
2251    fn default() -> Self {
2252        Self::Amex
2253    }
2254}
2255
2256/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard`'s `request_three_d_secure` field.
2257#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2258#[serde(rename_all = "snake_case")]
2259pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure {
2260    Any,
2261    Automatic,
2262    Challenge,
2263}
2264
2265impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure {
2266    pub fn as_str(self) -> &'static str {
2267        match self {
2268            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Any => "any",
2269            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic",
2270            CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge",
2271        }
2272    }
2273}
2274
2275impl AsRef<str> for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure {
2276    fn as_ref(&self) -> &str {
2277        self.as_str()
2278    }
2279}
2280
2281impl std::fmt::Display
2282    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure
2283{
2284    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2285        self.as_str().fmt(f)
2286    }
2287}
2288impl std::default::Default
2289    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure
2290{
2291    fn default() -> Self {
2292        Self::Any
2293    }
2294}
2295
2296/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field.
2297#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2298#[serde(rename_all = "snake_case")]
2299pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
2300{
2301    Balances,
2302    Ownership,
2303    PaymentMethod,
2304    Transactions,
2305}
2306
2307impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
2308    pub fn as_str(self) -> &'static str {
2309        match self {
2310            CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances",
2311            CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership",
2312            CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method",
2313            CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions",
2314        }
2315    }
2316}
2317
2318impl AsRef<str> for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
2319    fn as_ref(&self) -> &str {
2320        self.as_str()
2321    }
2322}
2323
2324impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
2325    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2326        self.as_str().fmt(f)
2327    }
2328}
2329impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
2330    fn default() -> Self {
2331        Self::Balances
2332    }
2333}
2334
2335/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field.
2336#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2337#[serde(rename_all = "snake_case")]
2338pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
2339{
2340    Balances,
2341    Transactions,
2342}
2343
2344impl
2345    CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
2346{
2347    pub fn as_str(self) -> &'static str {
2348        match self {
2349            CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances",
2350            CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions",
2351        }
2352    }
2353}
2354
2355impl AsRef<str> for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
2356    fn as_ref(&self) -> &str {
2357        self.as_str()
2358    }
2359}
2360
2361impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
2362    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2363        self.as_str().fmt(f)
2364    }
2365}
2366impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
2367    fn default() -> Self {
2368        Self::Balances
2369    }
2370}
2371
2372/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount`'s `verification_method` field.
2373#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2374#[serde(rename_all = "snake_case")]
2375pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod {
2376    Automatic,
2377    Instant,
2378    Microdeposits,
2379}
2380
2381impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod {
2382    pub fn as_str(self) -> &'static str {
2383        match self {
2384            CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic",
2385            CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant",
2386            CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => "microdeposits",
2387        }
2388    }
2389}
2390
2391impl AsRef<str>
2392    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod
2393{
2394    fn as_ref(&self) -> &str {
2395        self.as_str()
2396    }
2397}
2398
2399impl std::fmt::Display
2400    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod
2401{
2402    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2403        self.as_str().fmt(f)
2404    }
2405}
2406impl std::default::Default
2407    for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod
2408{
2409    fn default() -> Self {
2410        Self::Automatic
2411    }
2412}
2413
2414/// An enum representing the possible values of an `CreateSubscriptionPaymentSettings`'s `payment_method_types` field.
2415#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2416#[serde(rename_all = "snake_case")]
2417pub enum CreateSubscriptionPaymentSettingsPaymentMethodTypes {
2418    AchCreditTransfer,
2419    AchDebit,
2420    AcssDebit,
2421    AuBecsDebit,
2422    BacsDebit,
2423    Bancontact,
2424    Boleto,
2425    Card,
2426    Cashapp,
2427    CustomerBalance,
2428    Eps,
2429    Fpx,
2430    Giropay,
2431    Grabpay,
2432    Ideal,
2433    Konbini,
2434    Link,
2435    P24,
2436    Paynow,
2437    Paypal,
2438    Promptpay,
2439    SepaCreditTransfer,
2440    SepaDebit,
2441    Sofort,
2442    UsBankAccount,
2443    WechatPay,
2444}
2445
2446impl CreateSubscriptionPaymentSettingsPaymentMethodTypes {
2447    pub fn as_str(self) -> &'static str {
2448        match self {
2449            CreateSubscriptionPaymentSettingsPaymentMethodTypes::AchCreditTransfer => {
2450                "ach_credit_transfer"
2451            }
2452            CreateSubscriptionPaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit",
2453            CreateSubscriptionPaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit",
2454            CreateSubscriptionPaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit",
2455            CreateSubscriptionPaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit",
2456            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact",
2457            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Boleto => "boleto",
2458            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Card => "card",
2459            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Cashapp => "cashapp",
2460            CreateSubscriptionPaymentSettingsPaymentMethodTypes::CustomerBalance => {
2461                "customer_balance"
2462            }
2463            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Eps => "eps",
2464            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Fpx => "fpx",
2465            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Giropay => "giropay",
2466            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Grabpay => "grabpay",
2467            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Ideal => "ideal",
2468            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Konbini => "konbini",
2469            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Link => "link",
2470            CreateSubscriptionPaymentSettingsPaymentMethodTypes::P24 => "p24",
2471            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Paynow => "paynow",
2472            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Paypal => "paypal",
2473            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Promptpay => "promptpay",
2474            CreateSubscriptionPaymentSettingsPaymentMethodTypes::SepaCreditTransfer => {
2475                "sepa_credit_transfer"
2476            }
2477            CreateSubscriptionPaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit",
2478            CreateSubscriptionPaymentSettingsPaymentMethodTypes::Sofort => "sofort",
2479            CreateSubscriptionPaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account",
2480            CreateSubscriptionPaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay",
2481        }
2482    }
2483}
2484
2485impl AsRef<str> for CreateSubscriptionPaymentSettingsPaymentMethodTypes {
2486    fn as_ref(&self) -> &str {
2487        self.as_str()
2488    }
2489}
2490
2491impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodTypes {
2492    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2493        self.as_str().fmt(f)
2494    }
2495}
2496impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodTypes {
2497    fn default() -> Self {
2498        Self::AchCreditTransfer
2499    }
2500}
2501
2502/// An enum representing the possible values of an `CreateSubscriptionPaymentSettings`'s `save_default_payment_method` field.
2503#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2504#[serde(rename_all = "snake_case")]
2505pub enum CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod {
2506    Off,
2507    OnSubscription,
2508}
2509
2510impl CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod {
2511    pub fn as_str(self) -> &'static str {
2512        match self {
2513            CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::Off => "off",
2514            CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::OnSubscription => {
2515                "on_subscription"
2516            }
2517        }
2518    }
2519}
2520
2521impl AsRef<str> for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod {
2522    fn as_ref(&self) -> &str {
2523        self.as_str()
2524    }
2525}
2526
2527impl std::fmt::Display for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod {
2528    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2529        self.as_str().fmt(f)
2530    }
2531}
2532impl std::default::Default for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod {
2533    fn default() -> Self {
2534        Self::Off
2535    }
2536}
2537
2538/// An enum representing the possible values of an `CreateSubscriptionTrialSettingsEndBehavior`'s `missing_payment_method` field.
2539#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2540#[serde(rename_all = "snake_case")]
2541pub enum CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod {
2542    Cancel,
2543    CreateInvoice,
2544    Pause,
2545}
2546
2547impl CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod {
2548    pub fn as_str(self) -> &'static str {
2549        match self {
2550            CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel",
2551            CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => {
2552                "create_invoice"
2553            }
2554            CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause",
2555        }
2556    }
2557}
2558
2559impl AsRef<str> for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod {
2560    fn as_ref(&self) -> &str {
2561        self.as_str()
2562    }
2563}
2564
2565impl std::fmt::Display for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod {
2566    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2567        self.as_str().fmt(f)
2568    }
2569}
2570impl std::default::Default for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod {
2571    fn default() -> Self {
2572        Self::Cancel
2573    }
2574}
2575
2576/// An enum representing the possible values of an `InvoiceItemPriceData`'s `tax_behavior` field.
2577#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2578#[serde(rename_all = "snake_case")]
2579pub enum InvoiceItemPriceDataTaxBehavior {
2580    Exclusive,
2581    Inclusive,
2582    Unspecified,
2583}
2584
2585impl InvoiceItemPriceDataTaxBehavior {
2586    pub fn as_str(self) -> &'static str {
2587        match self {
2588            InvoiceItemPriceDataTaxBehavior::Exclusive => "exclusive",
2589            InvoiceItemPriceDataTaxBehavior::Inclusive => "inclusive",
2590            InvoiceItemPriceDataTaxBehavior::Unspecified => "unspecified",
2591        }
2592    }
2593}
2594
2595impl AsRef<str> for InvoiceItemPriceDataTaxBehavior {
2596    fn as_ref(&self) -> &str {
2597        self.as_str()
2598    }
2599}
2600
2601impl std::fmt::Display for InvoiceItemPriceDataTaxBehavior {
2602    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2603        self.as_str().fmt(f)
2604    }
2605}
2606impl std::default::Default for InvoiceItemPriceDataTaxBehavior {
2607    fn default() -> Self {
2608        Self::Exclusive
2609    }
2610}
2611
2612/// An enum representing the possible values of an `InvoiceMandateOptionsCard`'s `amount_type` field.
2613#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2614#[serde(rename_all = "snake_case")]
2615pub enum InvoiceMandateOptionsCardAmountType {
2616    Fixed,
2617    Maximum,
2618}
2619
2620impl InvoiceMandateOptionsCardAmountType {
2621    pub fn as_str(self) -> &'static str {
2622        match self {
2623            InvoiceMandateOptionsCardAmountType::Fixed => "fixed",
2624            InvoiceMandateOptionsCardAmountType::Maximum => "maximum",
2625        }
2626    }
2627}
2628
2629impl AsRef<str> for InvoiceMandateOptionsCardAmountType {
2630    fn as_ref(&self) -> &str {
2631        self.as_str()
2632    }
2633}
2634
2635impl std::fmt::Display for InvoiceMandateOptionsCardAmountType {
2636    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2637        self.as_str().fmt(f)
2638    }
2639}
2640impl std::default::Default for InvoiceMandateOptionsCardAmountType {
2641    fn default() -> Self {
2642        Self::Fixed
2643    }
2644}
2645
2646/// An enum representing the possible values of an `SubscriptionPendingInvoiceItemInterval`'s `interval` field.
2647#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2648#[serde(rename_all = "snake_case")]
2649pub enum PlanInterval {
2650    Day,
2651    Month,
2652    Week,
2653    Year,
2654}
2655
2656impl PlanInterval {
2657    pub fn as_str(self) -> &'static str {
2658        match self {
2659            PlanInterval::Day => "day",
2660            PlanInterval::Month => "month",
2661            PlanInterval::Week => "week",
2662            PlanInterval::Year => "year",
2663        }
2664    }
2665}
2666
2667impl AsRef<str> for PlanInterval {
2668    fn as_ref(&self) -> &str {
2669        self.as_str()
2670    }
2671}
2672
2673impl std::fmt::Display for PlanInterval {
2674    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2675        self.as_str().fmt(f)
2676    }
2677}
2678impl std::default::Default for PlanInterval {
2679    fn default() -> Self {
2680        Self::Day
2681    }
2682}
2683
2684/// An enum representing the possible values of an `UpdateSubscription`'s `billing_cycle_anchor` field.
2685#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2686#[serde(rename_all = "snake_case")]
2687pub enum SubscriptionBillingCycleAnchor {
2688    Now,
2689    Unchanged,
2690}
2691
2692impl SubscriptionBillingCycleAnchor {
2693    pub fn as_str(self) -> &'static str {
2694        match self {
2695            SubscriptionBillingCycleAnchor::Now => "now",
2696            SubscriptionBillingCycleAnchor::Unchanged => "unchanged",
2697        }
2698    }
2699}
2700
2701impl AsRef<str> for SubscriptionBillingCycleAnchor {
2702    fn as_ref(&self) -> &str {
2703        self.as_str()
2704    }
2705}
2706
2707impl std::fmt::Display for SubscriptionBillingCycleAnchor {
2708    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2709        self.as_str().fmt(f)
2710    }
2711}
2712impl std::default::Default for SubscriptionBillingCycleAnchor {
2713    fn default() -> Self {
2714        Self::Now
2715    }
2716}
2717
2718/// An enum representing the possible values of an `SubscriptionItemPriceData`'s `tax_behavior` field.
2719#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2720#[serde(rename_all = "snake_case")]
2721pub enum SubscriptionItemPriceDataTaxBehavior {
2722    Exclusive,
2723    Inclusive,
2724    Unspecified,
2725}
2726
2727impl SubscriptionItemPriceDataTaxBehavior {
2728    pub fn as_str(self) -> &'static str {
2729        match self {
2730            SubscriptionItemPriceDataTaxBehavior::Exclusive => "exclusive",
2731            SubscriptionItemPriceDataTaxBehavior::Inclusive => "inclusive",
2732            SubscriptionItemPriceDataTaxBehavior::Unspecified => "unspecified",
2733        }
2734    }
2735}
2736
2737impl AsRef<str> for SubscriptionItemPriceDataTaxBehavior {
2738    fn as_ref(&self) -> &str {
2739        self.as_str()
2740    }
2741}
2742
2743impl std::fmt::Display for SubscriptionItemPriceDataTaxBehavior {
2744    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2745        self.as_str().fmt(f)
2746    }
2747}
2748impl std::default::Default for SubscriptionItemPriceDataTaxBehavior {
2749    fn default() -> Self {
2750        Self::Exclusive
2751    }
2752}
2753
2754/// An enum representing the possible values of an `CreateSubscription`'s `payment_behavior` field.
2755#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2756#[serde(rename_all = "snake_case")]
2757pub enum SubscriptionPaymentBehavior {
2758    AllowIncomplete,
2759    DefaultIncomplete,
2760    ErrorIfIncomplete,
2761    PendingIfIncomplete,
2762}
2763
2764impl SubscriptionPaymentBehavior {
2765    pub fn as_str(self) -> &'static str {
2766        match self {
2767            SubscriptionPaymentBehavior::AllowIncomplete => "allow_incomplete",
2768            SubscriptionPaymentBehavior::DefaultIncomplete => "default_incomplete",
2769            SubscriptionPaymentBehavior::ErrorIfIncomplete => "error_if_incomplete",
2770            SubscriptionPaymentBehavior::PendingIfIncomplete => "pending_if_incomplete",
2771        }
2772    }
2773}
2774
2775impl AsRef<str> for SubscriptionPaymentBehavior {
2776    fn as_ref(&self) -> &str {
2777        self.as_str()
2778    }
2779}
2780
2781impl std::fmt::Display for SubscriptionPaymentBehavior {
2782    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2783        self.as_str().fmt(f)
2784    }
2785}
2786impl std::default::Default for SubscriptionPaymentBehavior {
2787    fn default() -> Self {
2788        Self::AllowIncomplete
2789    }
2790}
2791
2792/// An enum representing the possible values of an `SubscriptionPaymentMethodOptionsCard`'s `network` field.
2793#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2794#[serde(rename_all = "snake_case")]
2795pub enum SubscriptionPaymentMethodOptionsCardNetwork {
2796    Amex,
2797    CartesBancaires,
2798    Diners,
2799    Discover,
2800    EftposAu,
2801    Interac,
2802    Jcb,
2803    Mastercard,
2804    Unionpay,
2805    Unknown,
2806    Visa,
2807}
2808
2809impl SubscriptionPaymentMethodOptionsCardNetwork {
2810    pub fn as_str(self) -> &'static str {
2811        match self {
2812            SubscriptionPaymentMethodOptionsCardNetwork::Amex => "amex",
2813            SubscriptionPaymentMethodOptionsCardNetwork::CartesBancaires => "cartes_bancaires",
2814            SubscriptionPaymentMethodOptionsCardNetwork::Diners => "diners",
2815            SubscriptionPaymentMethodOptionsCardNetwork::Discover => "discover",
2816            SubscriptionPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au",
2817            SubscriptionPaymentMethodOptionsCardNetwork::Interac => "interac",
2818            SubscriptionPaymentMethodOptionsCardNetwork::Jcb => "jcb",
2819            SubscriptionPaymentMethodOptionsCardNetwork::Mastercard => "mastercard",
2820            SubscriptionPaymentMethodOptionsCardNetwork::Unionpay => "unionpay",
2821            SubscriptionPaymentMethodOptionsCardNetwork::Unknown => "unknown",
2822            SubscriptionPaymentMethodOptionsCardNetwork::Visa => "visa",
2823        }
2824    }
2825}
2826
2827impl AsRef<str> for SubscriptionPaymentMethodOptionsCardNetwork {
2828    fn as_ref(&self) -> &str {
2829        self.as_str()
2830    }
2831}
2832
2833impl std::fmt::Display for SubscriptionPaymentMethodOptionsCardNetwork {
2834    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2835        self.as_str().fmt(f)
2836    }
2837}
2838impl std::default::Default for SubscriptionPaymentMethodOptionsCardNetwork {
2839    fn default() -> Self {
2840        Self::Amex
2841    }
2842}
2843
2844/// An enum representing the possible values of an `SubscriptionPaymentMethodOptionsCard`'s `request_three_d_secure` field.
2845#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2846#[serde(rename_all = "snake_case")]
2847pub enum SubscriptionPaymentMethodOptionsCardRequestThreeDSecure {
2848    Any,
2849    Automatic,
2850    Challenge,
2851}
2852
2853impl SubscriptionPaymentMethodOptionsCardRequestThreeDSecure {
2854    pub fn as_str(self) -> &'static str {
2855        match self {
2856            SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::Any => "any",
2857            SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic",
2858            SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge",
2859        }
2860    }
2861}
2862
2863impl AsRef<str> for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure {
2864    fn as_ref(&self) -> &str {
2865        self.as_str()
2866    }
2867}
2868
2869impl std::fmt::Display for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure {
2870    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2871        self.as_str().fmt(f)
2872    }
2873}
2874impl std::default::Default for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure {
2875    fn default() -> Self {
2876        Self::Any
2877    }
2878}
2879
2880/// An enum representing the possible values of an `CreateSubscription`'s `proration_behavior` field.
2881#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2882#[serde(rename_all = "snake_case")]
2883pub enum SubscriptionProrationBehavior {
2884    AlwaysInvoice,
2885    CreateProrations,
2886    None,
2887}
2888
2889impl SubscriptionProrationBehavior {
2890    pub fn as_str(self) -> &'static str {
2891        match self {
2892            SubscriptionProrationBehavior::AlwaysInvoice => "always_invoice",
2893            SubscriptionProrationBehavior::CreateProrations => "create_prorations",
2894            SubscriptionProrationBehavior::None => "none",
2895        }
2896    }
2897}
2898
2899impl AsRef<str> for SubscriptionProrationBehavior {
2900    fn as_ref(&self) -> &str {
2901        self.as_str()
2902    }
2903}
2904
2905impl std::fmt::Display for SubscriptionProrationBehavior {
2906    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2907        self.as_str().fmt(f)
2908    }
2909}
2910impl std::default::Default for SubscriptionProrationBehavior {
2911    fn default() -> Self {
2912        Self::AlwaysInvoice
2913    }
2914}
2915
2916/// An enum representing the possible values of an `Subscription`'s `status` field.
2917#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2918#[serde(rename_all = "snake_case")]
2919pub enum SubscriptionStatus {
2920    Active,
2921    Canceled,
2922    Incomplete,
2923    IncompleteExpired,
2924    PastDue,
2925    Paused,
2926    Trialing,
2927    Unpaid,
2928}
2929
2930impl SubscriptionStatus {
2931    pub fn as_str(self) -> &'static str {
2932        match self {
2933            SubscriptionStatus::Active => "active",
2934            SubscriptionStatus::Canceled => "canceled",
2935            SubscriptionStatus::Incomplete => "incomplete",
2936            SubscriptionStatus::IncompleteExpired => "incomplete_expired",
2937            SubscriptionStatus::PastDue => "past_due",
2938            SubscriptionStatus::Paused => "paused",
2939            SubscriptionStatus::Trialing => "trialing",
2940            SubscriptionStatus::Unpaid => "unpaid",
2941        }
2942    }
2943}
2944
2945impl AsRef<str> for SubscriptionStatus {
2946    fn as_ref(&self) -> &str {
2947        self.as_str()
2948    }
2949}
2950
2951impl std::fmt::Display for SubscriptionStatus {
2952    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
2953        self.as_str().fmt(f)
2954    }
2955}
2956impl std::default::Default for SubscriptionStatus {
2957    fn default() -> Self {
2958        Self::Active
2959    }
2960}
2961
2962/// An enum representing the possible values of an `ListSubscriptions`'s `status` field.
2963#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
2964#[serde(rename_all = "snake_case")]
2965pub enum SubscriptionStatusFilter {
2966    Active,
2967    All,
2968    Canceled,
2969    Ended,
2970    Incomplete,
2971    IncompleteExpired,
2972    PastDue,
2973    Paused,
2974    Trialing,
2975    Unpaid,
2976}
2977
2978impl SubscriptionStatusFilter {
2979    pub fn as_str(self) -> &'static str {
2980        match self {
2981            SubscriptionStatusFilter::Active => "active",
2982            SubscriptionStatusFilter::All => "all",
2983            SubscriptionStatusFilter::Canceled => "canceled",
2984            SubscriptionStatusFilter::Ended => "ended",
2985            SubscriptionStatusFilter::Incomplete => "incomplete",
2986            SubscriptionStatusFilter::IncompleteExpired => "incomplete_expired",
2987            SubscriptionStatusFilter::PastDue => "past_due",
2988            SubscriptionStatusFilter::Paused => "paused",
2989            SubscriptionStatusFilter::Trialing => "trialing",
2990            SubscriptionStatusFilter::Unpaid => "unpaid",
2991        }
2992    }
2993}
2994
2995impl AsRef<str> for SubscriptionStatusFilter {
2996    fn as_ref(&self) -> &str {
2997        self.as_str()
2998    }
2999}
3000
3001impl std::fmt::Display for SubscriptionStatusFilter {
3002    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3003        self.as_str().fmt(f)
3004    }
3005}
3006impl std::default::Default for SubscriptionStatusFilter {
3007    fn default() -> Self {
3008        Self::Active
3009    }
3010}
3011
3012/// An enum representing the possible values of an `SubscriptionsResourcePauseCollection`'s `behavior` field.
3013#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3014#[serde(rename_all = "snake_case")]
3015pub enum SubscriptionsResourcePauseCollectionBehavior {
3016    KeepAsDraft,
3017    MarkUncollectible,
3018    Void,
3019}
3020
3021impl SubscriptionsResourcePauseCollectionBehavior {
3022    pub fn as_str(self) -> &'static str {
3023        match self {
3024            SubscriptionsResourcePauseCollectionBehavior::KeepAsDraft => "keep_as_draft",
3025            SubscriptionsResourcePauseCollectionBehavior::MarkUncollectible => "mark_uncollectible",
3026            SubscriptionsResourcePauseCollectionBehavior::Void => "void",
3027        }
3028    }
3029}
3030
3031impl AsRef<str> for SubscriptionsResourcePauseCollectionBehavior {
3032    fn as_ref(&self) -> &str {
3033        self.as_str()
3034    }
3035}
3036
3037impl std::fmt::Display for SubscriptionsResourcePauseCollectionBehavior {
3038    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3039        self.as_str().fmt(f)
3040    }
3041}
3042impl std::default::Default for SubscriptionsResourcePauseCollectionBehavior {
3043    fn default() -> Self {
3044        Self::KeepAsDraft
3045    }
3046}
3047
3048/// An enum representing the possible values of an `SubscriptionsResourcePaymentSettings`'s `payment_method_types` field.
3049#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3050#[serde(rename_all = "snake_case")]
3051pub enum SubscriptionsResourcePaymentSettingsPaymentMethodTypes {
3052    AchCreditTransfer,
3053    AchDebit,
3054    AcssDebit,
3055    AuBecsDebit,
3056    BacsDebit,
3057    Bancontact,
3058    Boleto,
3059    Card,
3060    Cashapp,
3061    CustomerBalance,
3062    Eps,
3063    Fpx,
3064    Giropay,
3065    Grabpay,
3066    Ideal,
3067    Konbini,
3068    Link,
3069    P24,
3070    Paynow,
3071    Paypal,
3072    Promptpay,
3073    SepaCreditTransfer,
3074    SepaDebit,
3075    Sofort,
3076    UsBankAccount,
3077    WechatPay,
3078}
3079
3080impl SubscriptionsResourcePaymentSettingsPaymentMethodTypes {
3081    pub fn as_str(self) -> &'static str {
3082        match self {
3083            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AchCreditTransfer => {
3084                "ach_credit_transfer"
3085            }
3086            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit",
3087            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit",
3088            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit",
3089            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit",
3090            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Bancontact => "bancontact",
3091            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Boleto => "boleto",
3092            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Card => "card",
3093            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Cashapp => "cashapp",
3094            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::CustomerBalance => {
3095                "customer_balance"
3096            }
3097            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Eps => "eps",
3098            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Fpx => "fpx",
3099            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Giropay => "giropay",
3100            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Grabpay => "grabpay",
3101            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Ideal => "ideal",
3102            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Konbini => "konbini",
3103            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Link => "link",
3104            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::P24 => "p24",
3105            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Paynow => "paynow",
3106            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Paypal => "paypal",
3107            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Promptpay => "promptpay",
3108            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::SepaCreditTransfer => {
3109                "sepa_credit_transfer"
3110            }
3111            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit",
3112            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Sofort => "sofort",
3113            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::UsBankAccount => {
3114                "us_bank_account"
3115            }
3116            SubscriptionsResourcePaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay",
3117        }
3118    }
3119}
3120
3121impl AsRef<str> for SubscriptionsResourcePaymentSettingsPaymentMethodTypes {
3122    fn as_ref(&self) -> &str {
3123        self.as_str()
3124    }
3125}
3126
3127impl std::fmt::Display for SubscriptionsResourcePaymentSettingsPaymentMethodTypes {
3128    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3129        self.as_str().fmt(f)
3130    }
3131}
3132impl std::default::Default for SubscriptionsResourcePaymentSettingsPaymentMethodTypes {
3133    fn default() -> Self {
3134        Self::AchCreditTransfer
3135    }
3136}
3137
3138/// An enum representing the possible values of an `SubscriptionsResourcePaymentSettings`'s `save_default_payment_method` field.
3139#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3140#[serde(rename_all = "snake_case")]
3141pub enum SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod {
3142    Off,
3143    OnSubscription,
3144}
3145
3146impl SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod {
3147    pub fn as_str(self) -> &'static str {
3148        match self {
3149            SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod::Off => "off",
3150            SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod::OnSubscription => {
3151                "on_subscription"
3152            }
3153        }
3154    }
3155}
3156
3157impl AsRef<str> for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod {
3158    fn as_ref(&self) -> &str {
3159        self.as_str()
3160    }
3161}
3162
3163impl std::fmt::Display for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod {
3164    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3165        self.as_str().fmt(f)
3166    }
3167}
3168impl std::default::Default for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod {
3169    fn default() -> Self {
3170        Self::Off
3171    }
3172}
3173
3174/// An enum representing the possible values of an `UpdateSubscriptionAutomaticTaxLiability`'s `type` field.
3175#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3176#[serde(rename_all = "snake_case")]
3177pub enum UpdateSubscriptionAutomaticTaxLiabilityType {
3178    Account,
3179    #[serde(rename = "self")]
3180    Self_,
3181}
3182
3183impl UpdateSubscriptionAutomaticTaxLiabilityType {
3184    pub fn as_str(self) -> &'static str {
3185        match self {
3186            UpdateSubscriptionAutomaticTaxLiabilityType::Account => "account",
3187            UpdateSubscriptionAutomaticTaxLiabilityType::Self_ => "self",
3188        }
3189    }
3190}
3191
3192impl AsRef<str> for UpdateSubscriptionAutomaticTaxLiabilityType {
3193    fn as_ref(&self) -> &str {
3194        self.as_str()
3195    }
3196}
3197
3198impl std::fmt::Display for UpdateSubscriptionAutomaticTaxLiabilityType {
3199    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3200        self.as_str().fmt(f)
3201    }
3202}
3203impl std::default::Default for UpdateSubscriptionAutomaticTaxLiabilityType {
3204    fn default() -> Self {
3205        Self::Account
3206    }
3207}
3208
3209/// An enum representing the possible values of an `UpdateSubscriptionCancellationDetails`'s `feedback` field.
3210#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3211#[serde(rename_all = "snake_case")]
3212pub enum UpdateSubscriptionCancellationDetailsFeedback {
3213    CustomerService,
3214    LowQuality,
3215    MissingFeatures,
3216    Other,
3217    SwitchedService,
3218    TooComplex,
3219    TooExpensive,
3220    Unused,
3221}
3222
3223impl UpdateSubscriptionCancellationDetailsFeedback {
3224    pub fn as_str(self) -> &'static str {
3225        match self {
3226            UpdateSubscriptionCancellationDetailsFeedback::CustomerService => "customer_service",
3227            UpdateSubscriptionCancellationDetailsFeedback::LowQuality => "low_quality",
3228            UpdateSubscriptionCancellationDetailsFeedback::MissingFeatures => "missing_features",
3229            UpdateSubscriptionCancellationDetailsFeedback::Other => "other",
3230            UpdateSubscriptionCancellationDetailsFeedback::SwitchedService => "switched_service",
3231            UpdateSubscriptionCancellationDetailsFeedback::TooComplex => "too_complex",
3232            UpdateSubscriptionCancellationDetailsFeedback::TooExpensive => "too_expensive",
3233            UpdateSubscriptionCancellationDetailsFeedback::Unused => "unused",
3234        }
3235    }
3236}
3237
3238impl AsRef<str> for UpdateSubscriptionCancellationDetailsFeedback {
3239    fn as_ref(&self) -> &str {
3240        self.as_str()
3241    }
3242}
3243
3244impl std::fmt::Display for UpdateSubscriptionCancellationDetailsFeedback {
3245    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3246        self.as_str().fmt(f)
3247    }
3248}
3249impl std::default::Default for UpdateSubscriptionCancellationDetailsFeedback {
3250    fn default() -> Self {
3251        Self::CustomerService
3252    }
3253}
3254
3255/// An enum representing the possible values of an `UpdateSubscriptionInvoiceSettingsIssuer`'s `type` field.
3256#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3257#[serde(rename_all = "snake_case")]
3258pub enum UpdateSubscriptionInvoiceSettingsIssuerType {
3259    Account,
3260    #[serde(rename = "self")]
3261    Self_,
3262}
3263
3264impl UpdateSubscriptionInvoiceSettingsIssuerType {
3265    pub fn as_str(self) -> &'static str {
3266        match self {
3267            UpdateSubscriptionInvoiceSettingsIssuerType::Account => "account",
3268            UpdateSubscriptionInvoiceSettingsIssuerType::Self_ => "self",
3269        }
3270    }
3271}
3272
3273impl AsRef<str> for UpdateSubscriptionInvoiceSettingsIssuerType {
3274    fn as_ref(&self) -> &str {
3275        self.as_str()
3276    }
3277}
3278
3279impl std::fmt::Display for UpdateSubscriptionInvoiceSettingsIssuerType {
3280    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3281        self.as_str().fmt(f)
3282    }
3283}
3284impl std::default::Default for UpdateSubscriptionInvoiceSettingsIssuerType {
3285    fn default() -> Self {
3286        Self::Account
3287    }
3288}
3289
3290/// An enum representing the possible values of an `UpdateSubscriptionPauseCollection`'s `behavior` field.
3291#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3292#[serde(rename_all = "snake_case")]
3293pub enum UpdateSubscriptionPauseCollectionBehavior {
3294    KeepAsDraft,
3295    MarkUncollectible,
3296    Void,
3297}
3298
3299impl UpdateSubscriptionPauseCollectionBehavior {
3300    pub fn as_str(self) -> &'static str {
3301        match self {
3302            UpdateSubscriptionPauseCollectionBehavior::KeepAsDraft => "keep_as_draft",
3303            UpdateSubscriptionPauseCollectionBehavior::MarkUncollectible => "mark_uncollectible",
3304            UpdateSubscriptionPauseCollectionBehavior::Void => "void",
3305        }
3306    }
3307}
3308
3309impl AsRef<str> for UpdateSubscriptionPauseCollectionBehavior {
3310    fn as_ref(&self) -> &str {
3311        self.as_str()
3312    }
3313}
3314
3315impl std::fmt::Display for UpdateSubscriptionPauseCollectionBehavior {
3316    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3317        self.as_str().fmt(f)
3318    }
3319}
3320impl std::default::Default for UpdateSubscriptionPauseCollectionBehavior {
3321    fn default() -> Self {
3322        Self::KeepAsDraft
3323    }
3324}
3325
3326/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field.
3327#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3328#[serde(rename_all = "snake_case")]
3329pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3330{
3331    Business,
3332    Personal,
3333}
3334
3335impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType {
3336    pub fn as_str(self) -> &'static str {
3337        match self {
3338            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business",
3339            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal",
3340        }
3341    }
3342}
3343
3344impl AsRef<str>
3345    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3346{
3347    fn as_ref(&self) -> &str {
3348        self.as_str()
3349    }
3350}
3351
3352impl std::fmt::Display
3353    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3354{
3355    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3356        self.as_str().fmt(f)
3357    }
3358}
3359impl std::default::Default
3360    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType
3361{
3362    fn default() -> Self {
3363        Self::Business
3364    }
3365}
3366
3367/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit`'s `verification_method` field.
3368#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3369#[serde(rename_all = "snake_case")]
3370pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod {
3371    Automatic,
3372    Instant,
3373    Microdeposits,
3374}
3375
3376impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod {
3377    pub fn as_str(self) -> &'static str {
3378        match self {
3379            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic",
3380            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant",
3381            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => "microdeposits",
3382        }
3383    }
3384}
3385
3386impl AsRef<str>
3387    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod
3388{
3389    fn as_ref(&self) -> &str {
3390        self.as_str()
3391    }
3392}
3393
3394impl std::fmt::Display
3395    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod
3396{
3397    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3398        self.as_str().fmt(f)
3399    }
3400}
3401impl std::default::Default
3402    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod
3403{
3404    fn default() -> Self {
3405        Self::Automatic
3406    }
3407}
3408
3409/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact`'s `preferred_language` field.
3410#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3411#[serde(rename_all = "snake_case")]
3412pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage {
3413    De,
3414    En,
3415    Fr,
3416    Nl,
3417}
3418
3419impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage {
3420    pub fn as_str(self) -> &'static str {
3421        match self {
3422            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::De => "de",
3423            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::En => "en",
3424            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr",
3425            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl",
3426        }
3427    }
3428}
3429
3430impl AsRef<str>
3431    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage
3432{
3433    fn as_ref(&self) -> &str {
3434        self.as_str()
3435    }
3436}
3437
3438impl std::fmt::Display
3439    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage
3440{
3441    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3442        self.as_str().fmt(f)
3443    }
3444}
3445impl std::default::Default
3446    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage
3447{
3448    fn default() -> Self {
3449        Self::De
3450    }
3451}
3452
3453/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions`'s `amount_type` field.
3454#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3455#[serde(rename_all = "snake_case")]
3456pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType {
3457    Fixed,
3458    Maximum,
3459}
3460
3461impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType {
3462    pub fn as_str(self) -> &'static str {
3463        match self {
3464            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed",
3465            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum",
3466        }
3467    }
3468}
3469
3470impl AsRef<str>
3471    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType
3472{
3473    fn as_ref(&self) -> &str {
3474        self.as_str()
3475    }
3476}
3477
3478impl std::fmt::Display
3479    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType
3480{
3481    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3482        self.as_str().fmt(f)
3483    }
3484}
3485impl std::default::Default
3486    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType
3487{
3488    fn default() -> Self {
3489        Self::Fixed
3490    }
3491}
3492
3493/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard`'s `network` field.
3494#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3495#[serde(rename_all = "snake_case")]
3496pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork {
3497    Amex,
3498    CartesBancaires,
3499    Diners,
3500    Discover,
3501    EftposAu,
3502    Interac,
3503    Jcb,
3504    Mastercard,
3505    Unionpay,
3506    Unknown,
3507    Visa,
3508}
3509
3510impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork {
3511    pub fn as_str(self) -> &'static str {
3512        match self {
3513            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Amex => "amex",
3514            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::CartesBancaires => {
3515                "cartes_bancaires"
3516            }
3517            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Diners => "diners",
3518            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Discover => {
3519                "discover"
3520            }
3521            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::EftposAu => {
3522                "eftpos_au"
3523            }
3524            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Interac => "interac",
3525            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Jcb => "jcb",
3526            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Mastercard => {
3527                "mastercard"
3528            }
3529            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Unionpay => {
3530                "unionpay"
3531            }
3532            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Unknown => "unknown",
3533            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Visa => "visa",
3534        }
3535    }
3536}
3537
3538impl AsRef<str> for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork {
3539    fn as_ref(&self) -> &str {
3540        self.as_str()
3541    }
3542}
3543
3544impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork {
3545    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3546        self.as_str().fmt(f)
3547    }
3548}
3549impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork {
3550    fn default() -> Self {
3551        Self::Amex
3552    }
3553}
3554
3555/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard`'s `request_three_d_secure` field.
3556#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3557#[serde(rename_all = "snake_case")]
3558pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure {
3559    Any,
3560    Automatic,
3561    Challenge,
3562}
3563
3564impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure {
3565    pub fn as_str(self) -> &'static str {
3566        match self {
3567            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Any => "any",
3568            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic",
3569            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge",
3570        }
3571    }
3572}
3573
3574impl AsRef<str> for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure {
3575    fn as_ref(&self) -> &str {
3576        self.as_str()
3577    }
3578}
3579
3580impl std::fmt::Display
3581    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure
3582{
3583    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3584        self.as_str().fmt(f)
3585    }
3586}
3587impl std::default::Default
3588    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure
3589{
3590    fn default() -> Self {
3591        Self::Any
3592    }
3593}
3594
3595/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field.
3596#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3597#[serde(rename_all = "snake_case")]
3598pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions
3599{
3600    Balances,
3601    Ownership,
3602    PaymentMethod,
3603    Transactions,
3604}
3605
3606impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
3607    pub fn as_str(self) -> &'static str {
3608        match self {
3609            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances",
3610            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership",
3611            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method",
3612            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions",
3613        }
3614    }
3615}
3616
3617impl AsRef<str> for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
3618    fn as_ref(&self) -> &str {
3619        self.as_str()
3620    }
3621}
3622
3623impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
3624    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3625        self.as_str().fmt(f)
3626    }
3627}
3628impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions {
3629    fn default() -> Self {
3630        Self::Balances
3631    }
3632}
3633
3634/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field.
3635#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3636#[serde(rename_all = "snake_case")]
3637pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3638{
3639    Balances,
3640    Transactions,
3641}
3642
3643impl
3644    UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch
3645{
3646    pub fn as_str(self) -> &'static str {
3647        match self {
3648            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances",
3649            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions",
3650        }
3651    }
3652}
3653
3654impl AsRef<str> for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
3655    fn as_ref(&self) -> &str {
3656        self.as_str()
3657    }
3658}
3659
3660impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
3661    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3662        self.as_str().fmt(f)
3663    }
3664}
3665impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch {
3666    fn default() -> Self {
3667        Self::Balances
3668    }
3669}
3670
3671/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount`'s `verification_method` field.
3672#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3673#[serde(rename_all = "snake_case")]
3674pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod {
3675    Automatic,
3676    Instant,
3677    Microdeposits,
3678}
3679
3680impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod {
3681    pub fn as_str(self) -> &'static str {
3682        match self {
3683            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic",
3684            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant",
3685            UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => "microdeposits",
3686        }
3687    }
3688}
3689
3690impl AsRef<str>
3691    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod
3692{
3693    fn as_ref(&self) -> &str {
3694        self.as_str()
3695    }
3696}
3697
3698impl std::fmt::Display
3699    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod
3700{
3701    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3702        self.as_str().fmt(f)
3703    }
3704}
3705impl std::default::Default
3706    for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod
3707{
3708    fn default() -> Self {
3709        Self::Automatic
3710    }
3711}
3712
3713/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettings`'s `payment_method_types` field.
3714#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3715#[serde(rename_all = "snake_case")]
3716pub enum UpdateSubscriptionPaymentSettingsPaymentMethodTypes {
3717    AchCreditTransfer,
3718    AchDebit,
3719    AcssDebit,
3720    AuBecsDebit,
3721    BacsDebit,
3722    Bancontact,
3723    Boleto,
3724    Card,
3725    Cashapp,
3726    CustomerBalance,
3727    Eps,
3728    Fpx,
3729    Giropay,
3730    Grabpay,
3731    Ideal,
3732    Konbini,
3733    Link,
3734    P24,
3735    Paynow,
3736    Paypal,
3737    Promptpay,
3738    SepaCreditTransfer,
3739    SepaDebit,
3740    Sofort,
3741    UsBankAccount,
3742    WechatPay,
3743}
3744
3745impl UpdateSubscriptionPaymentSettingsPaymentMethodTypes {
3746    pub fn as_str(self) -> &'static str {
3747        match self {
3748            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AchCreditTransfer => {
3749                "ach_credit_transfer"
3750            }
3751            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit",
3752            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit",
3753            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit",
3754            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit",
3755            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact",
3756            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Boleto => "boleto",
3757            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Card => "card",
3758            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Cashapp => "cashapp",
3759            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::CustomerBalance => {
3760                "customer_balance"
3761            }
3762            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Eps => "eps",
3763            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Fpx => "fpx",
3764            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Giropay => "giropay",
3765            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Grabpay => "grabpay",
3766            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Ideal => "ideal",
3767            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Konbini => "konbini",
3768            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Link => "link",
3769            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::P24 => "p24",
3770            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Paynow => "paynow",
3771            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Paypal => "paypal",
3772            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Promptpay => "promptpay",
3773            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::SepaCreditTransfer => {
3774                "sepa_credit_transfer"
3775            }
3776            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit",
3777            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Sofort => "sofort",
3778            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account",
3779            UpdateSubscriptionPaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay",
3780        }
3781    }
3782}
3783
3784impl AsRef<str> for UpdateSubscriptionPaymentSettingsPaymentMethodTypes {
3785    fn as_ref(&self) -> &str {
3786        self.as_str()
3787    }
3788}
3789
3790impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodTypes {
3791    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3792        self.as_str().fmt(f)
3793    }
3794}
3795impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodTypes {
3796    fn default() -> Self {
3797        Self::AchCreditTransfer
3798    }
3799}
3800
3801/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettings`'s `save_default_payment_method` field.
3802#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3803#[serde(rename_all = "snake_case")]
3804pub enum UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod {
3805    Off,
3806    OnSubscription,
3807}
3808
3809impl UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod {
3810    pub fn as_str(self) -> &'static str {
3811        match self {
3812            UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::Off => "off",
3813            UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::OnSubscription => {
3814                "on_subscription"
3815            }
3816        }
3817    }
3818}
3819
3820impl AsRef<str> for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod {
3821    fn as_ref(&self) -> &str {
3822        self.as_str()
3823    }
3824}
3825
3826impl std::fmt::Display for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod {
3827    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3828        self.as_str().fmt(f)
3829    }
3830}
3831impl std::default::Default for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod {
3832    fn default() -> Self {
3833        Self::Off
3834    }
3835}
3836
3837/// An enum representing the possible values of an `UpdateSubscriptionTrialSettingsEndBehavior`'s `missing_payment_method` field.
3838#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
3839#[serde(rename_all = "snake_case")]
3840pub enum UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod {
3841    Cancel,
3842    CreateInvoice,
3843    Pause,
3844}
3845
3846impl UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod {
3847    pub fn as_str(self) -> &'static str {
3848        match self {
3849            UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel",
3850            UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => {
3851                "create_invoice"
3852            }
3853            UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause",
3854        }
3855    }
3856}
3857
3858impl AsRef<str> for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod {
3859    fn as_ref(&self) -> &str {
3860        self.as_str()
3861    }
3862}
3863
3864impl std::fmt::Display for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod {
3865    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
3866        self.as_str().fmt(f)
3867    }
3868}
3869impl std::default::Default for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod {
3870    fn default() -> Self {
3871        Self::Cancel
3872    }
3873}